From: Shuah Khan <skhan@linuxfoundation.org>
To: Cai Huoqing <cai.huoqing@linux.dev>
Cc: Valentina Manea <valentina.manea.m@gmail.com>,
Shuah Khan <shuah@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH] usbip: vudc: Make use of the helper macro LIST_HEAD()
Date: Wed, 9 Feb 2022 09:00:37 -0700 [thread overview]
Message-ID: <8c8bcf5b-bbda-55e0-6a61-35bfafbafb78@linuxfoundation.org> (raw)
In-Reply-To: <20220209032813.38703-1-cai.huoqing@linux.dev>
On 2/8/22 8:28 PM, Cai Huoqing wrote:
> Replace "struct list_head head = LIST_HEAD_INIT(head)" with
> "LIST_HEAD(head)" to simplify the code.
>
> Signed-off-by: Cai Huoqing <cai.huoqing@linux.dev>
> ---
> drivers/usb/usbip/vudc_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/usbip/vudc_main.c b/drivers/usb/usbip/vudc_main.c
> index 678faa82598c..d43252b77efd 100644
> --- a/drivers/usb/usbip/vudc_main.c
> +++ b/drivers/usb/usbip/vudc_main.c
> @@ -26,7 +26,7 @@ static struct platform_driver vudc_driver = {
> },
> };
>
> -static struct list_head vudc_devices = LIST_HEAD_INIT(vudc_devices);
> +static LIST_HEAD(vudc_devices);
>
> static int __init init(void)
> {
>
Explain why this change simplifies the code and also add a comment
above LIST_HEAD
LIST_HEAD_INIT clearly states what it does, as a result it is easier
to understand the code.
thanks,
-- Shuah
next prev parent reply other threads:[~2022-02-09 16:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-09 3:28 [PATCH] usbip: vudc: Make use of the helper macro LIST_HEAD() Cai Huoqing
2022-02-09 16:00 ` Shuah Khan [this message]
2022-02-10 2:37 ` Cai Huoqing
2022-02-10 14:13 ` Shuah Khan
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=8c8bcf5b-bbda-55e0-6a61-35bfafbafb78@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=cai.huoqing@linux.dev \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=valentina.manea.m@gmail.com \
/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