netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH linux-next] mlxsw: spectrum: use netif_is_macsec() instead of open code
@ 2023-12-15 13:45 yang.guang5
  2023-12-15 14:40 ` Ioana Ciornei
  2023-12-17 12:42 ` kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: yang.guang5 @ 2023-12-15 13:45 UTC (permalink / raw)
  To: davem
  Cc: jiang.xuexin, chen.haonan2, cgel.zte, edumazet, kuba, pabeni, sd,
	netdev, linux-kernel

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);
 }

 static inline bool netif_is_macvlan(const struct net_device *dev)
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH linux-next] mlxsw: spectrum: use netif_is_macsec() instead of open code
  2023-12-15 13:45 [PATCH linux-next] mlxsw: spectrum: use netif_is_macsec() instead of open code yang.guang5
@ 2023-12-15 14:40 ` Ioana Ciornei
  2023-12-17 12:42 ` kernel test robot
  1 sibling, 0 replies; 3+ messages in thread
From: Ioana Ciornei @ 2023-12-15 14:40 UTC (permalink / raw)
  To: yang.guang5
  Cc: davem, jiang.xuexin, chen.haonan2, cgel.zte, edumazet, kuba,
	pabeni, sd, netdev, linux-kernel

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?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH linux-next] mlxsw: spectrum: use netif_is_macsec() instead of open code
  2023-12-15 13:45 [PATCH linux-next] mlxsw: spectrum: use netif_is_macsec() instead of open code yang.guang5
  2023-12-15 14:40 ` Ioana Ciornei
@ 2023-12-17 12:42 ` kernel test robot
  1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2023-12-17 12:42 UTC (permalink / raw)
  To: yang.guang5, davem
  Cc: llvm, oe-kbuild-all, jiang.xuexin, chen.haonan2, cgel.zte,
	edumazet, kuba, pabeni, sd, netdev, linux-kernel

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  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-17 12:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-15 13:45 [PATCH linux-next] mlxsw: spectrum: use netif_is_macsec() instead of open code yang.guang5
2023-12-15 14:40 ` Ioana Ciornei
2023-12-17 12:42 ` kernel test robot

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).