[PATCH libdrm v3 1/3] drmSL: Fix neighbor lookup

2015-03-26 Thread Emil Velikov
On 24/03/15 23:16, Jan Vesely wrote:
> Commit e4a519635f75bde38aeb5b09f2ff4efbf73453e9:
> Tidy up compile warnings by cleaning up types.
> 
> removed call to SLLocate which gutted the function of all functionality.
> This patch restores the original behavior, with an additional fix
> that zeros the update array in case SLLocate bails early.
> 
> v2: zero the update array instead of checking the return value.
> SLLocate returns NULL both on failure and if the element is greater
> than everything in the list
> v3: Improve commit message
> 
> Signed-off-by: Jan Vesely 
> Acked-by: Emil Velikov 
> ---
> sorry for spamming, just realized it might be a good idea co CC the original
> author and committer.
> 
> This was broken since 2.4.18 (2010). I guess it's safe to say that nobody
> uses it. What are the policies on removing parts of API?
> 
Either nobody uses it or nobody which uses it cases enough to report/fix
it. Either way I think that people prefer to be cautious and do API
cleanups alongside a major bump of the library.

-Emil



[PATCH libdrm v3 1/3] drmSL: Fix neighbor lookup

2015-03-24 Thread Jan Vesely
Commit e4a519635f75bde38aeb5b09f2ff4efbf73453e9:
Tidy up compile warnings by cleaning up types.

removed call to SLLocate which gutted the function of all functionality.
This patch restores the original behavior, with an additional fix
that zeros the update array in case SLLocate bails early.

v2: zero the update array instead of checking the return value.
SLLocate returns NULL both on failure and if the element is greater
than everything in the list
v3: Improve commit message

Signed-off-by: Jan Vesely 
Acked-by: Emil Velikov 
---
sorry for spamming, just realized it might be a good idea co CC the original
author and committer.

This was broken since 2.4.18 (2010). I guess it's safe to say that nobody
uses it. What are the policies on removing parts of API?

 xf86drmSL.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xf86drmSL.c b/xf86drmSL.c
index acddb54..cf588ac 100644
--- a/xf86drmSL.c
+++ b/xf86drmSL.c
@@ -264,12 +264,14 @@ int drmSLLookupNeighbors(void *l, unsigned long key,
 unsigned long *next_key, void **next_value)
 {
 SkipListPtr   list = (SkipListPtr)l;
-SLEntryPtrupdate[SL_MAX_LEVEL + 1];
+SLEntryPtrupdate[SL_MAX_LEVEL + 1] = {0};
 int   retcode = 0;

+SLLocate(list, key, update);
+
 *prev_key   = *next_key   = key;
 *prev_value = *next_value = NULL;
-   
+
 if (update[0]) {
*prev_key   = update[0]->key;
*prev_value = update[0]->value;
-- 
2.1.0