From: David Lamparter Date: Tue, 27 Nov 2012 02:21:44 +0000 (+0100) Subject: lib: remove ALL_LIST_ELEMENTS dead code branch X-Git-Tag: frr-2.0-rc1~1719 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=a5c851c7ff41ef846e83d62394176ac1753ebf45;p=matthieu%2Ffrr.git lib: remove ALL_LIST_ELEMENTS dead code branch ALL_LIST_ELEMENTS is checking node == NULL twice, which is causing a whole slew of false positives in Coverity. In this particular case, addressing this in the code is reasonable; being a macro, this appears all over the place without easy remedy. Acked-by: Scott Feldman Signed-off-by: David Lamparter --- diff --git a/lib/linklist.h b/lib/linklist.h index f0ae36256d..24a9e20698 100644 --- a/lib/linklist.h +++ b/lib/linklist.h @@ -90,7 +90,7 @@ extern void list_add_list (struct list *, struct list *); #define ALL_LIST_ELEMENTS(list,node,nextnode,data) \ (node) = listhead(list), ((data) = NULL); \ (node) != NULL && \ - ((data) = listgetdata(node),(nextnode) = listnextnode(node), 1); \ + ((data) = listgetdata(node),(nextnode) = node->next, 1); \ (node) = (nextnode), ((data) = NULL) /* read-only list iteration macro.