Message ID | 202312152145312776210@zte.com.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-1036-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9284815dys; Fri, 15 Dec 2023 05:46:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IHE5kIAevrsLtEvCJ9JNCIONSRqZSpt0+enOlLAkuKfNZGBUvY/OffbmH3frU45w8RFc65R X-Received: by 2002:a05:6359:7410:b0:170:17eb:1e7 with SMTP id va16-20020a056359741000b0017017eb01e7mr5441602rwb.42.1702647985445; Fri, 15 Dec 2023 05:46:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702647985; cv=none; d=google.com; s=arc-20160816; b=Gphbnse7ycTIV+mZ4Scvfg7QwBxjyA925bMoh3t+UnTaC1g8SqnS89qwVDSAz2yHRg h/8q+E2kSYbV5M8BRtVIuYfQHLxEMErIeotfndSrio2X1Y+yM/a5akA/vfcyU1YHyufq vKUTnNlSO5eDuM6EO8hzB0ppGuWC+zAnEKl+AvzAAGw0Ujb8SO6mtJ03yGsoposyf2se oa4MU2mSdkvwecGO2Z8vPtu0CzuvbISxfbfyEXIZ6kP/oNXQ7nlYfWB4x1OLiePsr0IB qImgwsJz9pmr8YTjZkf5lCHmUvplgFUqrVN14ddlOKsy6kI899x9CQDEpmB42On86WWE nj3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:cc:to:from:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:date; bh=YprdpLHYJ3u1/ghk9EJWzd+lCHP4vKWm21WOzGqn+yk=; fh=chNCcw4BQsFulrdjva6t6tzgLRxQIpcgaQqWI1Gj8QM=; b=T8F/7D/0fsFbOBEyJ+UhtkWGbEp5/qopbmAUC31FIkCkK/FWgP271FTHl6L/IlR1hG IrOt5IQZwaZ1zm7PJD9UMpCwFx/FeJxSFxnaoeogq3gnGin7Tc+l5VhydmogJOuKt0VG F3OpzeED6+ji6ZSamv+KOk1fsSWF+7k8OWqNgccMMQsPXzSPYj1XndIE+I99Kbkug2lE MmFUqu508k6Eroqp8GDQMXlsY4v2+krSYdrOJkr4EexVU/SEnKJGgNmw2rqVOKj8X71U zaG2BX7HQr9KUG5U1xntgboYruEciATinIZLoxkfouDO81it3TuAr9xrgoE241oURgNc OfjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1036-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1036-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id fh17-20020a056a00391100b006d0d865d05asi4116162pfb.295.2023.12.15.05.46.25 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 05:46:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1036-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1036-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1036-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 07A8AB22473 for <ouuuleilei@gmail.com>; Fri, 15 Dec 2023 13:46:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 076CC2EB13; Fri, 15 Dec 2023 13:45:43 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D5B522C852; Fri, 15 Dec 2023 13:45:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zte.com.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zte.com.cn Received: from mse-fl1.zte.com.cn (unknown [10.5.228.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4Ss9TS4Pr5z8XrRL; Fri, 15 Dec 2023 21:45:32 +0800 (CST) Received: from xaxapp02.zte.com.cn ([10.88.97.241]) by mse-fl1.zte.com.cn with SMTP id 3BFDjRWh071963; Fri, 15 Dec 2023 21:45:27 +0800 (+08) (envelope-from yang.guang5@zte.com.cn) Received: from mapi (xaxapp02[null]) by mapi (Zmail) with MAPI id mid31; Fri, 15 Dec 2023 21:45:31 +0800 (CST) Date: Fri, 15 Dec 2023 21:45:31 +0800 (CST) X-Zmail-TransId: 2afa657c587b3a7-53fc0 X-Mailer: Zmail v1.0 Message-ID: <202312152145312776210@zte.com.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> Mime-Version: 1.0 From: <yang.guang5@zte.com.cn> To: <davem@davemloft.net> Cc: <jiang.xuexin@zte.com.cn>, <chen.haonan2@zte.com.cn>, <cgel.zte@gmail.com>, <edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>, <sd@queasysnail.net>, <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org> Subject: =?utf-8?q?=5BPATCH_linux-next=5D_mlxsw=3A_spectrum=3A_use_netif=5Fi?= =?utf-8?q?s=5Fmacsec=28=29_instead_of_open_code?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl1.zte.com.cn 3BFDjRWh071963 X-Fangmail-Gw-Spam-Type: 0 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 657C587C.001/4Ss9TS4Pr5z8XrRL X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785355813995821608 X-GMAIL-MSGID: 1785355813995821608 |
Series |
[linux-next] mlxsw: spectrum: use netif_is_macsec() instead of open code
|
|
Commit Message
yang.guang5@zte.com.cn
Dec. 15, 2023, 1:45 p.m. UTC
From: Yang Guang <yang.guang5@zte.com.cn> Open code which is dev->priv_flags & IFF_MACSEC has already defined as netif_is_macsec(). So use netif_is_macsec() instead of open code. No functional changed. Signed-off-by: Chen Haonan <chen.haonan2@zte.com.cn> --- include/linux/netdevice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Fri, Dec 15, 2023 at 09:45:31PM +0800, yang.guang5@zte.com.cn wrote: > From: Yang Guang <yang.guang5@zte.com.cn> > > Open code which is dev->priv_flags & IFF_MACSEC has already defined as > netif_is_macsec(). So use netif_is_macsec() instead of open code. > No functional changed. > > Signed-off-by: Chen Haonan <chen.haonan2@zte.com.cn> > --- > include/linux/netdevice.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h > index 1b935ee341b4..1f2b23d854c9 100644 > --- a/include/linux/netdevice.h > +++ b/include/linux/netdevice.h > @@ -5103,7 +5103,7 @@ void netif_inherit_tso_max(struct net_device *to, > > static inline bool netif_is_macsec(const struct net_device *dev) > { > - return dev->priv_flags & IFF_MACSEC; > + return netif_is_macsec(dev); > } So you are replacing the actual implementation of the netif_is_macsec() function with a call to the same netif_is_macsec(). How does this work?
Hi,
kernel test robot noticed the following build warnings:
[auto build test WARNING on next-20231215]
url: https://github.com/intel-lab-lkp/linux/commits/yang-guang5-zte-com-cn/mlxsw-spectrum-use-netif_is_macsec-instead-of-open-code/20231215-214631
base: next-20231215
patch link: https://lore.kernel.org/r/202312152145312776210%40zte.com.cn
patch subject: [PATCH linux-next] mlxsw: spectrum: use netif_is_macsec() instead of open code
config: i386-buildonly-randconfig-003-20231217 (https://download.01.org/0day-ci/archive/20231217/202312172042.gMYseKZQ-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231217/202312172042.gMYseKZQ-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312172042.gMYseKZQ-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from kernel/cgroup/cgroup.c:33:
In file included from include/linux/bpf-cgroup.h:11:
In file included from include/net/sock.h:46:
>> include/linux/netdevice.h:5105:1: warning: all paths through this function will call itself [-Winfinite-recursion]
{
^
1 warning generated.
vim +5105 include/linux/netdevice.h
7967168cefdbc6 Herbert Xu 2006-06-22 5098
14d7b8122fd591 Jakub Kicinski 2022-05-05 5099 void netif_set_tso_max_size(struct net_device *dev, unsigned int size);
14d7b8122fd591 Jakub Kicinski 2022-05-05 5100 void netif_set_tso_max_segs(struct net_device *dev, unsigned int segs);
6df6398f7c8b48 Jakub Kicinski 2022-05-05 5101 void netif_inherit_tso_max(struct net_device *to,
6df6398f7c8b48 Jakub Kicinski 2022-05-05 5102 const struct net_device *from);
6df6398f7c8b48 Jakub Kicinski 2022-05-05 5103
3c17578473b9be Sabrina Dubroca 2016-03-11 5104 static inline bool netif_is_macsec(const struct net_device *dev)
3c17578473b9be Sabrina Dubroca 2016-03-11 @5105 {
55cddeca5e222e Yang Guang 2023-12-15 5106 return netif_is_macsec(dev);
3c17578473b9be Sabrina Dubroca 2016-03-11 5107 }
3c17578473b9be Sabrina Dubroca 2016-03-11 5108
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 1b935ee341b4..1f2b23d854c9 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -5103,7 +5103,7 @@ void netif_inherit_tso_max(struct net_device *to, static inline bool netif_is_macsec(const struct net_device *dev) { - return dev->priv_flags & IFF_MACSEC; + return netif_is_macsec(dev); } static inline bool netif_is_macvlan(const struct net_device *dev)