Blob Blame History Raw
From 8cd6a54fc05d726cc84c6c5b3dc551d208d1ddc1 Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Wed, 2 Oct 2013 07:00:14 +0200
Subject: [PATCH 2/8] Fix error in hlist_for_each_entry_safe macro.

RH-Author: Gerd Hoffmann <kraxel@redhat.com>
Message-id: <1380697219-1860-3-git-send-email-kraxel@redhat.com>
Patchwork-id: 54629
O-Subject: [RHEL-7 seabios PATCH 2/7] Fix error in hlist_for_each_entry_safe macro.
Bugzilla: 947051
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Bandan Das <bsd@redhat.com>
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>

From: Kevin O'Connor <kevin@koconnor.net>

Fix broken macro - it did not work correctly at all.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
(cherry picked from commit 9539e41c4d8701c19434457288c38109da163ffc)
---
 src/list.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 src/list.h |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/list.h b/src/list.h
index db7e962..0f0909b 100644
--- a/src/list.h
+++ b/src/list.h
@@ -68,8 +68,7 @@ hlist_add_after(struct hlist_node *n, struct hlist_node *prev)
 
 #define hlist_for_each_entry_safe(pos, pprev, head, member)             \
     for (pprev = &(head)->first                                         \
-         ; *pprev                                                       \
-           && ({ pos=container_of((*pprev)->next, typeof(*pos), member); 1; }) \
+         ; *pprev && ({ pos=container_of(*pprev, typeof(*pos), member); 1; }) \
          ; pprev = &(*pprev)->next)
 
 
-- 
1.7.1