Thread (2 messages) 2 messages, 2 authors, 2011-02-14

Re: [PATCH] Staging: hv: Use list_entry for msg_info and remove associated comment

From: Greg KH <gregkh@suse.de>
Date: 2011-02-14 18:33:54
Also in: lkml

On Mon, Feb 14, 2011 at 10:35:37AM -0800, Hank Janssen wrote:
quoted hunk ↗ jump to hunk
Change code to use list_entry api. And removed comment
suggesting that change.

Signed-off-by: Abhishek Kane <redacted>
Signed-off-by: K.Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Hank Janssen <redacted>

---
 drivers/staging/hv/channel_mgmt.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/hv/channel_mgmt.c b/drivers/staging/hv/channel_mgmt.c
index a9c9d49..6c497e9 100644
--- a/drivers/staging/hv/channel_mgmt.c
+++ b/drivers/staging/hv/channel_mgmt.c
@@ -580,8 +580,9 @@ static void vmbus_onopen_result(struct vmbus_channel_message_header *hdr)
 	spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
 
 	list_for_each(curr, &vmbus_connection.chn_msg_list) {
-/* FIXME: this should probably use list_entry() instead */
-		msginfo = (struct vmbus_channel_msginfo *)curr;
+		msginfo = list_entry(curr, struct vmbus_channel_msginfo,
+				msglistentry);
How about using list_for_each_entry() instead?  That's the "preferred"
way to do things these days, and it saves you an extra line of code :)

thanks,

greg k-h
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help