Re: [PATCH net-next] net: make ndo_get_stats64 a void function

2017-01-06 Thread kbuild test robot
Hi Stephen,

[auto build test WARNING on net-next/master]

url:
https://github.com/0day-ci/linux/commits/Stephen-Hemminger/net-make-ndo_get_stats64-a-void-function/20170106-160123
config: xtensa-allmodconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 4.9.0
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=xtensa 

All warnings (new ones prefixed by >>):

   drivers/net/macsec.c: In function 'macsec_get_stats64':
>> drivers/net/macsec.c:2897:3: warning: 'return' with a value, in function 
>> returning void
  return s;
  ^

vim +/return +2897 drivers/net/macsec.c

c09440f7 Sabrina Dubroca   2016-03-11  2881 unsigned int extra = 
macsec->secy.icv_len + macsec_extra_len(true);
c09440f7 Sabrina Dubroca   2016-03-11  2882  
c09440f7 Sabrina Dubroca   2016-03-11  2883 if (macsec->real_dev->mtu - 
extra < new_mtu)
c09440f7 Sabrina Dubroca   2016-03-11  2884 return -ERANGE;
c09440f7 Sabrina Dubroca   2016-03-11  2885  
c09440f7 Sabrina Dubroca   2016-03-11  2886 dev->mtu = new_mtu;
c09440f7 Sabrina Dubroca   2016-03-11  2887  
c09440f7 Sabrina Dubroca   2016-03-11  2888 return 0;
c09440f7 Sabrina Dubroca   2016-03-11  2889  }
c09440f7 Sabrina Dubroca   2016-03-11  2890  
1e665d95 Stephen Hemminger 2017-01-05  2891  static void 
macsec_get_stats64(struct net_device *dev,
c09440f7 Sabrina Dubroca   2016-03-11  2892struct 
rtnl_link_stats64 *s)
c09440f7 Sabrina Dubroca   2016-03-11  2893  {
c09440f7 Sabrina Dubroca   2016-03-11  2894 int cpu;
c09440f7 Sabrina Dubroca   2016-03-11  2895  
c09440f7 Sabrina Dubroca   2016-03-11  2896 if (!dev->tstats)
c09440f7 Sabrina Dubroca   2016-03-11 @2897 return s;
c09440f7 Sabrina Dubroca   2016-03-11  2898  
c09440f7 Sabrina Dubroca   2016-03-11  2899 for_each_possible_cpu(cpu) {
c09440f7 Sabrina Dubroca   2016-03-11  2900 struct pcpu_sw_netstats 
*stats;
c09440f7 Sabrina Dubroca   2016-03-11  2901 struct pcpu_sw_netstats 
tmp;
c09440f7 Sabrina Dubroca   2016-03-11  2902 int start;
c09440f7 Sabrina Dubroca   2016-03-11  2903  
c09440f7 Sabrina Dubroca   2016-03-11  2904 stats = 
per_cpu_ptr(dev->tstats, cpu);
c09440f7 Sabrina Dubroca   2016-03-11  2905 do {

:: The code at line 2897 was first introduced by commit
:: c09440f7dcb304002dfced8c0fea289eb25f2da0 macsec: introduce IEEE 802.1AE 
driver

:: TO: Sabrina Dubroca 
:: CC: David S. Miller 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


Re: [PATCH net-next] net: make ndo_get_stats64 a void function

2017-01-06 Thread kbuild test robot
Hi Stephen,

[auto build test WARNING on net-next/master]

url:
https://github.com/0day-ci/linux/commits/Stephen-Hemminger/net-make-ndo_get_stats64-a-void-function/20170106-160123
config: x86_64-acpi-redef (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/broadcom/bnx2.c: In function 'bnx2_get_stats64':
>> drivers/net/ethernet/broadcom/bnx2.c:6830:10: warning: 'return' with a 
>> value, in function returning void
  return net_stats;
 ^
   drivers/net/ethernet/broadcom/bnx2.c:6825:1: note: declared here
bnx2_get_stats64(struct net_device *dev, struct rtnl_link_stats64 
*net_stats)
^~~~

vim +/return +6830 drivers/net/ethernet/broadcom/bnx2.c

5d07bf26 drivers/net/bnx2.c   Eric Dumazet  2010-07-08  
6814(((u64) (ctr##_hi) << 32) + (u64) (ctr##_lo))
b6016b76 drivers/net/bnx2.c   Michael Chan  2005-05-26  
6815  
a4743058 drivers/net/bnx2.c   Michael Chan  2010-01-17  
6816  #define GET_64BIT_NET_STATS(ctr)  \
354fcd77 drivers/net/bnx2.c   Michael Chan  2010-01-17  
6817GET_64BIT_NET_STATS64(bp->stats_blk->ctr) + \
354fcd77 drivers/net/bnx2.c   Michael Chan  2010-01-17  
6818GET_64BIT_NET_STATS64(bp->temp_stats_blk->ctr)
b6016b76 drivers/net/bnx2.c   Michael Chan  2005-05-26  
6819  
a4743058 drivers/net/bnx2.c   Michael Chan  2010-01-17  
6820  #define GET_32BIT_NET_STATS(ctr)  \
354fcd77 drivers/net/bnx2.c   Michael Chan  2010-01-17  
6821(unsigned long) (bp->stats_blk->ctr +   \
354fcd77 drivers/net/bnx2.c   Michael Chan  2010-01-17  
6822 bp->temp_stats_blk->ctr)
a4743058 drivers/net/bnx2.c   Michael Chan  2010-01-17  
6823  
1e665d95 drivers/net/ethernet/broadcom/bnx2.c Stephen Hemminger 2017-01-05  
6824  static void
5d07bf26 drivers/net/bnx2.c   Eric Dumazet  2010-07-08  
6825  bnx2_get_stats64(struct net_device *dev, struct rtnl_link_stats64 
*net_stats)
b6016b76 drivers/net/bnx2.c   Michael Chan  2005-05-26  
6826  {
972ec0d4 drivers/net/bnx2.c   Michael Chan  2006-01-23  
6827struct bnx2 *bp = netdev_priv(dev);
b6016b76 drivers/net/bnx2.c   Michael Chan  2005-05-26  
6828  
5d07bf26 drivers/net/bnx2.c   Eric Dumazet  2010-07-08  
6829if (bp->stats_blk == NULL)
b6016b76 drivers/net/bnx2.c   Michael Chan  2005-05-26 
@6830return net_stats;
5d07bf26 drivers/net/bnx2.c   Eric Dumazet  2010-07-08  
6831  
b6016b76 drivers/net/bnx2.c   Michael Chan  2005-05-26  
6832net_stats->rx_packets =
a4743058 drivers/net/bnx2.c   Michael Chan  2010-01-17  
6833GET_64BIT_NET_STATS(stat_IfHCInUcastPkts) +
a4743058 drivers/net/bnx2.c   Michael Chan  2010-01-17  
6834GET_64BIT_NET_STATS(stat_IfHCInMulticastPkts) +
a4743058 drivers/net/bnx2.c   Michael Chan  2010-01-17  
6835GET_64BIT_NET_STATS(stat_IfHCInBroadcastPkts);
b6016b76 drivers/net/bnx2.c   Michael Chan  2005-05-26  
6836  
b6016b76 drivers/net/bnx2.c   Michael Chan  2005-05-26  
6837net_stats->tx_packets =
a4743058 drivers/net/bnx2.c   Michael Chan  2010-01-17  
6838GET_64BIT_NET_STATS(stat_IfHCOutUcastPkts) +

:: The code at line 6830 was first introduced by commit
:: b6016b767397258b58163494a869f8f1199e6897 [BNX2]: New Broadcom gigabit 
network driver.

:: TO: Michael Chan 
:: CC: David S. Miller 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


Re: [PATCH net-next] net: make ndo_get_stats64 a void function

2017-01-05 Thread David Miller
From: Stephen Hemminger 
Date: Thu,  5 Jan 2017 09:31:36 -0800

> The network device operation for reading statistics is only called
> in one place, and it ignores the return value. Having a structure
> return value is potentially confusing because some future driver could
> incorrectly assume that the return value was used.
> 
> Fix all drivers with ndo_get_stats64 to have a void function.
> 
> Signed-off-by: Stephen Hemminger 

You missed at least one new warning, please do a fresh allmodconfig build
and watch the logs.

drivers/net/ethernet/broadcom/bnx2.c: In function ‘bnx2_get_stats64’:
drivers/net/ethernet/broadcom/bnx2.c:6830:10: warning: ‘return’ with a value, 
in function returning void

Thanks.