lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20110214183322.GA27858@suse.de>
Date:	Mon, 14 Feb 2011 10:33:22 -0800
From:	Greg KH <gregkh@...e.de>
To:	Hank Janssen <hjanssen@...rosoft.com>
Cc:	haiyangz@...rosoft.com, linux-kernel@...r.kernel.org,
	devel@...uxdriverproject.org, virtualization@...ts.osdl.org,
	Abhishek Kane <v-abkane@...rosoft.com>,
	"K.Y. Srinivasan" <kys@...rosoft.com>
Subject: Re: [PATCH] Staging: hv: Use list_entry for msg_info and remove
 associated comment

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@...rosoft.com>
> Signed-off-by: K.Y. Srinivasan <kys@...rosoft.com>
> Signed-off-by: Hank Janssen <hjanssen@...rosoft.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ