Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751367Ab1BNSdy (ORCPT ); Mon, 14 Feb 2011 13:33:54 -0500 Received: from cantor.suse.de ([195.135.220.2]:35013 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750764Ab1BNSdv (ORCPT ); Mon, 14 Feb 2011 13:33:51 -0500 Date: Mon, 14 Feb 2011 10:33:22 -0800 From: Greg KH To: Hank Janssen Cc: haiyangz@microsoft.com, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, virtualization@lists.osdl.org, Abhishek Kane , "K.Y. Srinivasan" Subject: Re: [PATCH] Staging: hv: Use list_entry for msg_info and remove associated comment Message-ID: <20110214183322.GA27858@suse.de> References: <1297708537-15981-1-git-send-email-hjanssen@microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1297708537-15981-1-git-send-email-hjanssen@microsoft.com> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1468 Lines: 36 On Mon, Feb 14, 2011 at 10:35:37AM -0800, Hank Janssen wrote: > Change code to use list_entry api. And removed comment > suggesting that change. > > Signed-off-by: Abhishek Kane > Signed-off-by: K.Y. Srinivasan > Signed-off-by: Hank Janssen > > --- > 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/