Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2585970pxb; Thu, 10 Feb 2022 00:34:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJwlVu4UR9AQ+h9PU1QkRUWX4PbvuSh/p1QT06GuIbmPvFhzSaMk/tqqK7s5ZTezoerlNb8/ X-Received: by 2002:a17:907:e87:: with SMTP id ho7mr5415286ejc.648.1644482051482; Thu, 10 Feb 2022 00:34:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644482051; cv=none; d=google.com; s=arc-20160816; b=lWN6EnucrJGFs8bcXuVAqw74Eu6PyOkKqTGunjslaPNc/L888bQj8LvP9qbKEIMYOr qQEPyHAjccNXtj1WlddI63zBianDH/aJweVEw+5ZBBZ3z0j49eshHutavSywJPdOrS5R OIOToJ8LkX99sGuF+tfYB8Eyywa9VRsDN1rj/3+QRwg7QrG0lQLGzsgaMWTjFf+wlEZQ vS/DlUjcJBajvQ9/KDLgnJrZVa1Cb4xAzUvXabqfcRoIKqbFRXZUGk9KErk8c6pvhdFt yjLJl21guU8uiIG/O99eqgdnSGEKZxhTPXpCHEuzV8HlE4xYAh+/sJgKwefjLv4hpIvU RK8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:dkim-signature:date; bh=f52O7WU1jwjZjNL8pYiw1viyPBOlQoX/LtWrz0nwoZU=; b=HtGAYVWjumaUbTl3Y/e9MISCR+CyCiAtgnfRA16h5tZjpQ5h3cce8V+1QTsZfzfyqW q8Zbs8SKyHIIWP6L81aXjtjx1zay1cAEIZtSb8EIboHWVd7iajxCQnk60P1zBmvHohIB V+fuQ6Aw70FK1/2KAZYHELcmryo0ZG88g8r8glu7sIzkYTHidpogNqg5fEgM7xsAg+L8 kjmaLHfj4BAc2QnfPN2wsgT17kfxoqaz4f8dckm8QhpfmlgvB7INbvM6k4Az/NZV0s7c Squ9Ihe6Xn0Ovu7L5n9lx5XnXgcI9QJ8pyEReBHhWpLWvGsz5y2rLKRqP63xkrBOTBUu Mjuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=t1IVKDGv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne5si2410438ejc.378.2022.02.10.00.33.46; Thu, 10 Feb 2022 00:34:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=t1IVKDGv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230084AbiBJChn (ORCPT + 99 others); Wed, 9 Feb 2022 21:37:43 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:49332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229511AbiBJChm (ORCPT ); Wed, 9 Feb 2022 21:37:42 -0500 Received: from out0.migadu.com (out0.migadu.com [IPv6:2001:41d0:2:267::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D12B10E2 for ; Wed, 9 Feb 2022 18:37:41 -0800 (PST) Date: Thu, 10 Feb 2022 10:37:14 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1644460659; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=f52O7WU1jwjZjNL8pYiw1viyPBOlQoX/LtWrz0nwoZU=; b=t1IVKDGvHGmQCcYPWGCk9v+IX1EUYsLful9GLVsg57O/OrX44rmgLM0/Sz3lt8c+sBH9vZ Ox1Ez1l1gHVncc4IX3DGcrgHllFaWWgaoHzOsH8qKoQcCHxh44tA/ukH72TaLFxNktDC48 oHy1Vl0FyCvcIzyYJYYJ5Vo6vUxEh+0= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Cai Huoqing To: Shuah Khan Cc: Valentina Manea , Shuah Khan , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usbip: vudc: Make use of the helper macro LIST_HEAD() Message-ID: <20220210023714.GA7791@chq-T47> References: <20220209032813.38703-1-cai.huoqing@linux.dev> <8c8bcf5b-bbda-55e0-6a61-35bfafbafb78@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8c8bcf5b-bbda-55e0-6a61-35bfafbafb78@linuxfoundation.org> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09 2月 22 09:00:37, Shuah Khan wrote: > 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 > > --- > > 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() help to clean up the code "struct list_head vudc_devices = ". we only to care the variable 'vudc_devices', > > LIST_HEAD_INIT clearly states what it does, as a result it is easier > to understand the code. LIST_HEAD() is defined for 17 years, lots of drivers use it directly. It's not about code readability. Thanks, Cai > > thanks, > -- Shuah