From: Greg KH <gregkh@suse.de>
To: Hank Janssen <hjanssen@microsoft.com>
Cc: haiyangz@microsoft.com, linux-kernel@vger.kernel.org,
devel@linuxdriverproject.org, virtualization@lists.osdl.org,
Abhishek Kane <v-abkane@microsoft.com>,
"K.Y. Srinivasan" <kys@microsoft.com>
Subject: Re: [PATCH] Staging: hv: Use list_entry for msg_info and remove associated comment
Date: Mon, 14 Feb 2011 10:33:22 -0800 [thread overview]
Message-ID: <20110214183322.GA27858@suse.de> (raw)
In-Reply-To: <1297708537-15981-1-git-send-email-hjanssen@microsoft.com>
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 <v-abkane@microsoft.com>
> Signed-off-by: K.Y. Srinivasan <kys@microsoft.com>
> Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
>
> ---
> 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
prev parent reply other threads:[~2011-02-14 18:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-14 18:35 [PATCH] Staging: hv: Use list_entry for msg_info and remove associated comment Hank Janssen
2011-02-14 18:33 ` Greg KH [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110214183322.GA27858@suse.de \
--to=gregkh@suse.de \
--cc=devel@linuxdriverproject.org \
--cc=haiyangz@microsoft.com \
--cc=hjanssen@microsoft.com \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=v-abkane@microsoft.com \
--cc=virtualization@lists.osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).