[PATCH 03/34] ptrlist: simplify DO_NEXT link walking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 ptrlist.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ptrlist.h b/ptrlist.h
index 9bdce843d..7ecf2b529 100644
--- a/ptrlist.h
+++ b/ptrlist.h
@@ -118,10 +118,10 @@ static inline void *last_ptr_list(struct ptr_list *list)
 			if (++__nr < __list->nr) {					\
 				ptr = PTR_ENTRY(__list,__nr);				\
 			} else {							\
-				__list = __list->next;					\
 				ptr = NULL;						\
-				while (__list->nr == 0 && __list != __head)		\
+				do							\
 					__list = __list->next;				\
+				while (__list->nr == 0 && __list != __head);		\
 				if (__list != __head) {					\
 					__nr = 0;					\
 					ptr = PTR_ENTRY(__list,0);			\
-- 
2.13.0

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux