Hi Daejun,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on mkp-scsi/for-next]
[also build test WARNING on scsi/for-next next-20210419]
[cannot apply to linus/master v5.12-rc8]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url:
https://github.com/0day-ci/linux/commits/Daejun-Park/scsi-ufs-Add-batched...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
config: x86_64-randconfig-a012-20210419 (attached as .config)
compiler: clang version 13.0.0 (
https://github.com/llvm/llvm-project
ca8eef7e3da8f750d7c7aa004fe426d1d34787ea)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
#
https://github.com/0day-ci/linux/commit/9f59814819c3a0ab46c3f1faf61332a03...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Daejun-Park/scsi-ufs-Add-batched-WB-buffer-flush/20210420-105527
git checkout 9f59814819c3a0ab46c3f1faf61332a03a158de2
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
> drivers/scsi/ufs/ufs-sysfs.c:290:6: warning: variable
'res' is used uninitialized whenever 'if' condition is true
[-Wsometimes-uninitialized]
if (wb_batched_flush ==
hba->vps->wb_batched_flush)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/ufs/ufs-sysfs.c:301:9: note: uninitialized use occurs here
return res < 0 ? res : count;
^~~
drivers/scsi/ufs/ufs-sysfs.c:290:2: note: remove the 'if' if its condition is
always false
if (wb_batched_flush == hba->vps->wb_batched_flush)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/ufs/ufs-sysfs.c:271:13: note: initialize the variable 'res' to
silence this warning
ssize_t res;
^
= 0
1 warning generated.
vim +290 drivers/scsi/ufs/ufs-sysfs.c
264
265 static ssize_t wb_batched_flush_store(struct device *dev,
266 struct device_attribute *attr,
267 const char *buf, size_t count)
268 {
269 struct ufs_hba *hba = dev_get_drvdata(dev);
270 unsigned int wb_batched_flush;
271 ssize_t res;
272
273 if (!ufshcd_is_wb_allowed(hba)) {
274 dev_warn(dev, "To control WB through wb_batched_flush is not
allowed!\n");
275 return -EOPNOTSUPP;
276 }
277
278 if (kstrtouint(buf, 0, &wb_batched_flush))
279 return -EINVAL;
280
281 if (wb_batched_flush != 0 && wb_batched_flush != 1)
282 return -EINVAL;
283
284 down(&hba->host_sem);
285 if (!ufshcd_is_user_access_allowed(hba)) {
286 res = -EBUSY;
287 goto out;
288 }
289
290 if (wb_batched_flush == hba->vps->wb_batched_flush)
291 goto out;
292
293 pm_runtime_get_sync(hba->dev);
294 res = ufshcd_wb_toggle_flush_during_h8(hba, !wb_batched_flush);
295 pm_runtime_put_sync(hba->dev);
296 if (!res)
297 hba->vps->wb_batched_flush = wb_batched_flush;
298
299 out:
300 up(&hba->host_sem);
301 return res < 0 ? res : count;
302 }
303
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org