opensm/complib/cl_ptr_vector.c: fix bug/compiler warning
PATCH 1/1 opensm/complib/cl_ptr_vector.c: fix bug/compiler warning
Hi Sasha,
Fixing a bug in cl_ptr_vector_find_from_end(), discovered by compiler's warning:
cl_ptr_vector.c: In function 'cl_ptr_vector_find_from_end':
cl_ptr_vector.c:305: warning: operation on 'i' may be undefined
--- opensm/complib/cl_ptr_vector.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
opensm/complib/cl_ptr_vector.c +2 -1
@@ -302,7 +302,8 @@ size_t cl_ptr_vector_find_from_end(IN const cl_ptr_vector_t * const p_vector,while (i) {/* Invoke the callback for the current element. */ -if (pfn_callback (i, (void *)p_vector->p_ptr_array[--i], + i--; +if (pfn_callback (i, (void *)p_vector->p_ptr_array[i], (void *)context) ==CL_SUCCESS ) {return (i); }
Signature · 6 lines
1.5.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 4B6828B6.5050005-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org
Sasha Khapyorsky
AppliedQuoted 9 lines · Yevgeny Kliteynik
Hi Sasha,
Fixing a bug in
cl_ptr_vector_find_from_end(), discovered by compiler's warning:
cl_ptr_vector.c: In function 'cl_ptr_vector_find_from_end':
cl_ptr_vector.c:305: warning: operation on 'i' may be undefinedSigned-off-by Yevgeny Kliteynik <[email protected]>
Applied. Thanks.
Sasha
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html