[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202205102144.vmTlPCDp-lkp@intel.com>
Date: Tue, 10 May 2022 21:43:37 +0800
From: kernel test robot <lkp@...el.com>
To: Yi Yang <yiyang13@...wei.com>, chris@...kel.net,
jcmvbkbc@...il.com, viro@...iv.linux.org.uk
Cc: kbuild-all@...ts.01.org, linux-xtensa@...ux-xtensa.org,
linux-kernel@...r.kernel.org, axboe@...nel.dk,
wangweiyang2@...wei.com
Subject: Re: [PATCH -next] xtensa/simdisk: fix error handling in
proc_read_simdisk()
Hi Yi,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on next-20220509]
url: https://github.com/intel-lab-lkp/linux/commits/Yi-Yang/xtensa-simdisk-fix-error-handling-in-proc_read_simdisk/20220510-161001
base: ab38272e99730375c5db3db1c4cebf691a0550ab
config: xtensa-allyesconfig (https://download.01.org/0day-ci/archive/20220510/202205102144.vmTlPCDp-lkp@intel.com/config)
compiler: xtensa-linux-gcc (GCC) 11.3.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://github.com/intel-lab-lkp/linux/commit/62cd9e58ed970829827bd2bfb24f2515a08fd921
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Yi-Yang/xtensa-simdisk-fix-error-handling-in-proc_read_simdisk/20220510-161001
git checkout 62cd9e58ed970829827bd2bfb24f2515a08fd921
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=xtensa SHELL=/bin/bash arch/xtensa/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
arch/xtensa/platforms/iss/simdisk.c: In function 'proc_read_simdisk':
>> arch/xtensa/platforms/iss/simdisk.c:223:17: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
223 | ssize_t n = simple_read_from_buffer(buf, size, ppos,
| ^~~~~~~
vim +223 arch/xtensa/platforms/iss/simdisk.c
b6c7e873daf765 Victor Prupis 2008-05-19 207
a69755b187749e Al Viro 2013-03-31 208 static ssize_t proc_read_simdisk(struct file *file, char __user *buf,
a69755b187749e Al Viro 2013-03-31 209 size_t size, loff_t *ppos)
b6c7e873daf765 Victor Prupis 2008-05-19 210 {
359745d78351c6 Muchun Song 2022-01-21 211 struct simdisk *dev = pde_data(file_inode(file));
0757f6159f13dc Geert Uytterhoeven 2013-05-09 212 const char *s = dev->filename;
62cd9e58ed9708 Yi Yang 2022-05-10 213 char *temp;
62cd9e58ed9708 Yi Yang 2022-05-10 214
a69755b187749e Al Viro 2013-03-31 215 if (s) {
62cd9e58ed9708 Yi Yang 2022-05-10 216 ssize_t len = strlen(s);
62cd9e58ed9708 Yi Yang 2022-05-10 217
62cd9e58ed9708 Yi Yang 2022-05-10 218 temp = kmalloc(len + 2, GFP_KERNEL);
62cd9e58ed9708 Yi Yang 2022-05-10 219 if (!temp)
62cd9e58ed9708 Yi Yang 2022-05-10 220 return -ENOMEM;
62cd9e58ed9708 Yi Yang 2022-05-10 221
62cd9e58ed9708 Yi Yang 2022-05-10 222 scnprintf(temp, len + 2, "%s\n", s);
a69755b187749e Al Viro 2013-03-31 @223 ssize_t n = simple_read_from_buffer(buf, size, ppos,
62cd9e58ed9708 Yi Yang 2022-05-10 224 temp, strlen(temp));
62cd9e58ed9708 Yi Yang 2022-05-10 225
62cd9e58ed9708 Yi Yang 2022-05-10 226 kfree(temp);
a69755b187749e Al Viro 2013-03-31 227 return n;
a69755b187749e Al Viro 2013-03-31 228 }
a69755b187749e Al Viro 2013-03-31 229 return simple_read_from_buffer(buf, size, ppos, "\n", 1);
b6c7e873daf765 Victor Prupis 2008-05-19 230 }
b6c7e873daf765 Victor Prupis 2008-05-19 231
--
0-DAY CI Kernel Test Service
https://01.org/lkp
Powered by blists - more mailing lists