[dinguyen:socfpga-5.14_v1 7/121] drivers/misc/altera_ilc.c:67:13: warning: variable 'ret' set but not used

From: kernel test robot
Date: Fri Nov 05 2021 - 08:32:52 EST


Hi Dinh,

First bad commit (maybe != root cause):

tree: https://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux.git socfpga-5.14_v1
head: cc7ba8d9b34b85acfbeefb77fa57c116c733c2c4
commit: 72ffec01d5fac567909fdf8c7e0bc2cc08228653 [7/121] FogBugz #236669: Add a Kconfig for ILC driver
config: mips-allyesconfig (attached as .config)
compiler: mips-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux.git/commit/?id=72ffec01d5fac567909fdf8c7e0bc2cc08228653
git remote add dinguyen https://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux.git
git fetch --no-tags dinguyen socfpga-5.14_v1
git checkout 72ffec01d5fac567909fdf8c7e0bc2cc08228653
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=mips

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

drivers/misc/altera_ilc.c: In function 'ilc_show_counter':
>> drivers/misc/altera_ilc.c:67:13: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
67 | int ret, i, id, fifo_len;
| ^~~
drivers/misc/altera_ilc.c: In function 'ilc_work':
drivers/misc/altera_ilc.c:110:33: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
110 | unsigned int ilc_value, ret, offset, stp_reg;
| ^~~


vim +/ret +67 drivers/misc/altera_ilc.c

326c1813f0b702 cnphoon 2014-02-21 63
326c1813f0b702 cnphoon 2014-02-21 64 static ssize_t ilc_show_counter(struct device *dev,
326c1813f0b702 cnphoon 2014-02-21 65 struct device_attribute *attr, char *buf)
326c1813f0b702 cnphoon 2014-02-21 66 {
326c1813f0b702 cnphoon 2014-02-21 @67 int ret, i, id, fifo_len;
326c1813f0b702 cnphoon 2014-02-21 68 unsigned int fifo_buf[ILC_MAX_PORTS];
326c1813f0b702 cnphoon 2014-02-21 69 char temp[10];
326c1813f0b702 cnphoon 2014-02-21 70 struct altera_ilc *ilc = dev_get_drvdata(dev);
326c1813f0b702 cnphoon 2014-02-21 71
326c1813f0b702 cnphoon 2014-02-21 72 fifo_len = 0;
326c1813f0b702 cnphoon 2014-02-21 73 ret = kstrtouint(attr->attr.name, 0, &id);
326c1813f0b702 cnphoon 2014-02-21 74
326c1813f0b702 cnphoon 2014-02-21 75 for (i = 0; i < ilc->port_count; i++) {
326c1813f0b702 cnphoon 2014-02-21 76 if (id == (ilc->interrupt_channels[i])) {
326c1813f0b702 cnphoon 2014-02-21 77 /*Check for kfifo length*/
326c1813f0b702 cnphoon 2014-02-21 78 fifo_len = kfifo_len(&ilc->kfifos[i])
326c1813f0b702 cnphoon 2014-02-21 79 /sizeof(unsigned int);
326c1813f0b702 cnphoon 2014-02-21 80 if (fifo_len <= 0) {
326c1813f0b702 cnphoon 2014-02-21 81 dev_info(&ilc->pdev->dev, "Fifo for interrupt %s is empty\n",
326c1813f0b702 cnphoon 2014-02-21 82 attr->attr.name);
326c1813f0b702 cnphoon 2014-02-21 83 return 0;
326c1813f0b702 cnphoon 2014-02-21 84 }
326c1813f0b702 cnphoon 2014-02-21 85 /*Read from kfifo*/
326c1813f0b702 cnphoon 2014-02-21 86 ret = kfifo_out(&ilc->kfifos[i], &fifo_buf,
326c1813f0b702 cnphoon 2014-02-21 87 kfifo_len(&ilc->kfifos[i]));
326c1813f0b702 cnphoon 2014-02-21 88 }
326c1813f0b702 cnphoon 2014-02-21 89 }
326c1813f0b702 cnphoon 2014-02-21 90
326c1813f0b702 cnphoon 2014-02-21 91 for (i = 0; i < fifo_len; i++) {
326c1813f0b702 cnphoon 2014-02-21 92 sprintf(temp, "%u\n", fifo_buf[i]);
326c1813f0b702 cnphoon 2014-02-21 93 strcat(buf, temp);
326c1813f0b702 cnphoon 2014-02-21 94 }
326c1813f0b702 cnphoon 2014-02-21 95
326c1813f0b702 cnphoon 2014-02-21 96 strcat(buf, "\0");
326c1813f0b702 cnphoon 2014-02-21 97
326c1813f0b702 cnphoon 2014-02-21 98 return strlen(buf);
326c1813f0b702 cnphoon 2014-02-21 99 }
326c1813f0b702 cnphoon 2014-02-21 100

:::::: The code at line 67 was first introduced by commit
:::::: 326c1813f0b70239f0c06d52091461646e393bd4 FogBugz #178225: Add Altera interrupt latency counter driver

:::::: TO: cnphoon <cnphoon@xxxxxxxxxx>
:::::: CC: Dinh Nguyen <dinh.nguyen@xxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip