[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202209251238.S9p1EePq-lkp@intel.com>
Date: Sun, 25 Sep 2022 12:59:27 +0800
From: kernel test robot <lkp@...el.com>
To: Arnd Bergmann <arnd@...db.de>
Cc: kbuild-all@...ts.01.org, Ammar Faizi <ammarfaizi2@...weeb.org>,
GNU/Weeb Mailing List <gwml@...r.gnuweeb.org>,
linux-kernel@...r.kernel.org, Sasha Levin <sashal@...nel.org>,
Christoph Hellwig <hch@....de>
Subject: [ammarfaizi2-block:stable/linux-stable-rc/queue/5.10 106/119]
net/core/dev_ioctl.c:41:13: warning: unused variable 'i'
tree: https://github.com/ammarfaizi2/linux-block stable/linux-stable-rc/queue/5.10
head: 0ed01873ed141e2095cc1e0545ab5a54a55c99a6
commit: 41ecdcac6be18abe4e5a75e5925f5a4f6d3e508c [106/119] net: socket: remove register_gifconf
config: i386-randconfig-a001
compiler: gcc-11 (Debian 11.3.0-5) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/ammarfaizi2/linux-block/commit/41ecdcac6be18abe4e5a75e5925f5a4f6d3e508c
git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
git fetch --no-tags ammarfaizi2-block stable/linux-stable-rc/queue/5.10
git checkout 41ecdcac6be18abe4e5a75e5925f5a4f6d3e508c
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash net/core/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
net/core/dev_ioctl.c: In function 'dev_ifconf':
>> net/core/dev_ioctl.c:41:13: warning: unused variable 'i' [-Wunused-variable]
41 | int i;
| ^
vim +/i +41 net/core/dev_ioctl.c
96b45cbd956ce8 Cong Wang 2013-02-15 28
96b45cbd956ce8 Cong Wang 2013-02-15 29 /*
96b45cbd956ce8 Cong Wang 2013-02-15 30 * Perform a SIOCGIFCONF call. This structure will change
96b45cbd956ce8 Cong Wang 2013-02-15 31 * size eventually, and there is nothing I can do about it.
96b45cbd956ce8 Cong Wang 2013-02-15 32 * Thus we will need a 'compatibility mode'.
96b45cbd956ce8 Cong Wang 2013-02-15 33 */
96b45cbd956ce8 Cong Wang 2013-02-15 34
36fd633ec98acd Al Viro 2017-06-26 35 int dev_ifconf(struct net *net, struct ifconf *ifc, int size)
96b45cbd956ce8 Cong Wang 2013-02-15 36 {
96b45cbd956ce8 Cong Wang 2013-02-15 37 struct net_device *dev;
96b45cbd956ce8 Cong Wang 2013-02-15 38 char __user *pos;
96b45cbd956ce8 Cong Wang 2013-02-15 39 int len;
96b45cbd956ce8 Cong Wang 2013-02-15 40 int total;
96b45cbd956ce8 Cong Wang 2013-02-15 @41 int i;
96b45cbd956ce8 Cong Wang 2013-02-15 42
96b45cbd956ce8 Cong Wang 2013-02-15 43 /*
96b45cbd956ce8 Cong Wang 2013-02-15 44 * Fetch the caller's info block.
96b45cbd956ce8 Cong Wang 2013-02-15 45 */
96b45cbd956ce8 Cong Wang 2013-02-15 46
36fd633ec98acd Al Viro 2017-06-26 47 pos = ifc->ifc_buf;
36fd633ec98acd Al Viro 2017-06-26 48 len = ifc->ifc_len;
96b45cbd956ce8 Cong Wang 2013-02-15 49
96b45cbd956ce8 Cong Wang 2013-02-15 50 /*
96b45cbd956ce8 Cong Wang 2013-02-15 51 * Loop over the interfaces, and write an info block for each.
96b45cbd956ce8 Cong Wang 2013-02-15 52 */
96b45cbd956ce8 Cong Wang 2013-02-15 53
96b45cbd956ce8 Cong Wang 2013-02-15 54 total = 0;
96b45cbd956ce8 Cong Wang 2013-02-15 55 for_each_netdev(net, dev) {
96b45cbd956ce8 Cong Wang 2013-02-15 56 int done;
96b45cbd956ce8 Cong Wang 2013-02-15 57 if (!pos)
41ecdcac6be18a Arnd Bergmann 2021-07-22 58 done = inet_gifconf(dev, NULL, 0, size);
96b45cbd956ce8 Cong Wang 2013-02-15 59 else
41ecdcac6be18a Arnd Bergmann 2021-07-22 60 done = inet_gifconf(dev, pos + total,
36fd633ec98acd Al Viro 2017-06-26 61 len - total, size);
96b45cbd956ce8 Cong Wang 2013-02-15 62 if (done < 0)
96b45cbd956ce8 Cong Wang 2013-02-15 63 return -EFAULT;
96b45cbd956ce8 Cong Wang 2013-02-15 64 total += done;
96b45cbd956ce8 Cong Wang 2013-02-15 65 }
96b45cbd956ce8 Cong Wang 2013-02-15 66
96b45cbd956ce8 Cong Wang 2013-02-15 67 /*
96b45cbd956ce8 Cong Wang 2013-02-15 68 * All done. Write the updated control block back to the caller.
96b45cbd956ce8 Cong Wang 2013-02-15 69 */
36fd633ec98acd Al Viro 2017-06-26 70 ifc->ifc_len = total;
96b45cbd956ce8 Cong Wang 2013-02-15 71
96b45cbd956ce8 Cong Wang 2013-02-15 72 /*
96b45cbd956ce8 Cong Wang 2013-02-15 73 * Both BSD and Solaris return 0 here, so we do too.
96b45cbd956ce8 Cong Wang 2013-02-15 74 */
36fd633ec98acd Al Viro 2017-06-26 75 return 0;
96b45cbd956ce8 Cong Wang 2013-02-15 76 }
96b45cbd956ce8 Cong Wang 2013-02-15 77
:::::: The code at line 41 was first introduced by commit
:::::: 96b45cbd956ce83908378d87d009b05645353f22 net: move ioctl functions into a separated file
:::::: TO: Cong Wang <xiyou.wangcong@...il.com>
:::::: CC: David S. Miller <davem@...emloft.net>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (137108 bytes)
Powered by blists - more mailing lists