Re: [PATCH] uacce: Tidy up locking

From: kernel test robot
Date: Mon Jun 20 2022 - 16:19:08 EST


Hi Jean-Philippe,

I love your patch! Perhaps something to improve:

[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on soc/for-next linus/master v5.19-rc2 next-20220617]
[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/intel-lab-lkp/linux/commits/Jean-Philippe-Brucker/uacce-Tidy-up-locking/20220620-220634
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 0a35780c755ccec097d15c6b4ff8b246a89f1689
config: i386-randconfig-s001 (https://download.01.org/0day-ci/archive/20220621/202206210432.WVkOxVu5-lkp@xxxxxxxxx/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-30-g92122700-dirty
# https://github.com/intel-lab-lkp/linux/commit/3589b5391f54bea3dc85ed65fe0f036757a4f21c
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Jean-Philippe-Brucker/uacce-Tidy-up-locking/20220620-220634
git checkout 3589b5391f54bea3dc85ed65fe0f036757a4f21c
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash drivers/misc/uacce/

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


sparse warnings: (new ones prefixed by >>)
>> drivers/misc/uacce/uacce.c:291:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected int ret @@ got restricted __poll_t @@
drivers/misc/uacce/uacce.c:291:21: sparse: expected int ret
drivers/misc/uacce/uacce.c:291:21: sparse: got restricted __poll_t
>> drivers/misc/uacce/uacce.c:295:16: sparse: sparse: incorrect type in return expression (different base types) @@ expected restricted __poll_t @@ got int ret @@
drivers/misc/uacce/uacce.c:295:16: sparse: expected restricted __poll_t
drivers/misc/uacce/uacce.c:295:16: sparse: got int ret

vim +291 drivers/misc/uacce/uacce.c

277
278 static __poll_t uacce_fops_poll(struct file *file, poll_table *wait)
279 {
280 struct uacce_queue *q = file->private_data;
281 struct uacce_device *uacce = q->uacce;
282 int ret = 0;
283
284 poll_wait(file, &q->wait, wait);
285
286 mutex_lock(&q->mutex);
287 if (!uacce_queue_is_valid(q))
288 goto out_unlock;
289
290 if (uacce->ops->is_q_updated && uacce->ops->is_q_updated(q))
> 291 ret = EPOLLIN | EPOLLRDNORM;
292
293 out_unlock:
294 mutex_unlock(&q->mutex);
> 295 return ret;
296 }
297

--
0-DAY CI Kernel Test Service
https://01.org/lkp