From: kernel test robot <lkp@intel.com>
To: Yishai Hadas <yishaih@nvidia.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
linux-kernel@vger.kernel.org, Jason Gunthorpe <jgg@nvidia.com>,
Leon Romanovsky <leonro@nvidia.com>
Subject: [jgunthorpe:for-yishai 12/17] drivers/vfio/pci/mlx5/main.c:254:10: warning: result of comparison of constant 9223372036854775807 with expression of type 'size_t' (aka 'unsigned int') is always false
Date: Sat, 29 Jan 2022 14:52:21 +0800 [thread overview]
Message-ID: <202201291323.OBtyolrA-lkp@intel.com> (raw)
tree: https://github.com/jgunthorpe/linux for-yishai
head: f63f92a10949b3ad5f769771001e82774bcef055
commit: 70ccf2dd2a78780dd3fd87a7112938ce05da498c [12/17] vfio/mlx5: Implement vfio_pci driver for mlx5 devices
config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20220129/202201291323.OBtyolrA-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 33b45ee44b1f32ffdbc995e6fec806271b4b3ba4)
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/jgunthorpe/linux/commit/70ccf2dd2a78780dd3fd87a7112938ce05da498c
git remote add jgunthorpe https://github.com/jgunthorpe/linux
git fetch --no-tags jgunthorpe for-yishai
git checkout 70ccf2dd2a78780dd3fd87a7112938ce05da498c
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/vfio/pci/mlx5/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/vfio/pci/mlx5/main.c:254:10: warning: result of comparison of constant 9223372036854775807 with expression of type 'size_t' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare]
if (len > type_max(loff_t) || *pos < 0 ||
~~~ ^ ~~~~~~~~~~~~~~~~
1 warning generated.
vim +254 drivers/vfio/pci/mlx5/main.c
242
243 static ssize_t mlx5vf_resume_write(struct file *filp, const char __user *buf,
244 size_t len, loff_t *pos)
245 {
246 struct mlx5_vf_migration_file *migf = filp->private_data;
247 loff_t requested_length;
248 ssize_t done = 0;
249
250 if (pos)
251 return -ESPIPE;
252 pos = &filp->f_pos;
253
> 254 if (len > type_max(loff_t) || *pos < 0 ||
255 check_add_overflow((loff_t)len, *pos, &requested_length))
256 return -EINVAL;
257
258 if (requested_length > MAX_MIGRATION_SIZE)
259 return -ENOMEM;
260
261 mutex_lock(&migf->lock);
262 if (migf->disabled) {
263 done = -ENODEV;
264 goto out_unlock;
265 }
266
267 if (migf->allocated_length < requested_length) {
268 done = mlx5vf_add_migration_pages(
269 migf,
270 DIV_ROUND_UP(requested_length - migf->allocated_length,
271 PAGE_SIZE));
272 if (done)
273 goto out_unlock;
274 }
275
276 while (len) {
277 size_t page_offset;
278 struct page *page;
279 size_t page_len;
280 u8 *to_buff;
281 int ret;
282
283 page_offset = (*pos) % PAGE_SIZE;
284 page = mlx5vf_get_migration_page(migf, *pos - page_offset);
285 if (!page) {
286 if (done == 0)
287 done = -EINVAL;
288 goto out_unlock;
289 }
290
291 page_len = min_t(size_t, len, PAGE_SIZE - page_offset);
292 to_buff = kmap_local_page(page);
293 ret = copy_from_user(to_buff + page_offset, buf, page_len);
294 kunmap_local(to_buff);
295 if (ret) {
296 done = -EFAULT;
297 goto out_unlock;
298 }
299 *pos += page_len;
300 len -= page_len;
301 done += page_len;
302 buf += page_len;
303 migf->total_length += page_len;
304 }
305 out_unlock:
306 mutex_unlock(&migf->lock);
307 return done;
308 }
309
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [jgunthorpe:for-yishai 12/17] drivers/vfio/pci/mlx5/main.c:254:10: warning: result of comparison of constant 9223372036854775807 with expression of type 'size_t' (aka 'unsigned int') is always false
Date: Sat, 29 Jan 2022 14:52:21 +0800 [thread overview]
Message-ID: <202201291323.OBtyolrA-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3769 bytes --]
tree: https://github.com/jgunthorpe/linux for-yishai
head: f63f92a10949b3ad5f769771001e82774bcef055
commit: 70ccf2dd2a78780dd3fd87a7112938ce05da498c [12/17] vfio/mlx5: Implement vfio_pci driver for mlx5 devices
config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20220129/202201291323.OBtyolrA-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 33b45ee44b1f32ffdbc995e6fec806271b4b3ba4)
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/jgunthorpe/linux/commit/70ccf2dd2a78780dd3fd87a7112938ce05da498c
git remote add jgunthorpe https://github.com/jgunthorpe/linux
git fetch --no-tags jgunthorpe for-yishai
git checkout 70ccf2dd2a78780dd3fd87a7112938ce05da498c
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/vfio/pci/mlx5/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/vfio/pci/mlx5/main.c:254:10: warning: result of comparison of constant 9223372036854775807 with expression of type 'size_t' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare]
if (len > type_max(loff_t) || *pos < 0 ||
~~~ ^ ~~~~~~~~~~~~~~~~
1 warning generated.
vim +254 drivers/vfio/pci/mlx5/main.c
242
243 static ssize_t mlx5vf_resume_write(struct file *filp, const char __user *buf,
244 size_t len, loff_t *pos)
245 {
246 struct mlx5_vf_migration_file *migf = filp->private_data;
247 loff_t requested_length;
248 ssize_t done = 0;
249
250 if (pos)
251 return -ESPIPE;
252 pos = &filp->f_pos;
253
> 254 if (len > type_max(loff_t) || *pos < 0 ||
255 check_add_overflow((loff_t)len, *pos, &requested_length))
256 return -EINVAL;
257
258 if (requested_length > MAX_MIGRATION_SIZE)
259 return -ENOMEM;
260
261 mutex_lock(&migf->lock);
262 if (migf->disabled) {
263 done = -ENODEV;
264 goto out_unlock;
265 }
266
267 if (migf->allocated_length < requested_length) {
268 done = mlx5vf_add_migration_pages(
269 migf,
270 DIV_ROUND_UP(requested_length - migf->allocated_length,
271 PAGE_SIZE));
272 if (done)
273 goto out_unlock;
274 }
275
276 while (len) {
277 size_t page_offset;
278 struct page *page;
279 size_t page_len;
280 u8 *to_buff;
281 int ret;
282
283 page_offset = (*pos) % PAGE_SIZE;
284 page = mlx5vf_get_migration_page(migf, *pos - page_offset);
285 if (!page) {
286 if (done == 0)
287 done = -EINVAL;
288 goto out_unlock;
289 }
290
291 page_len = min_t(size_t, len, PAGE_SIZE - page_offset);
292 to_buff = kmap_local_page(page);
293 ret = copy_from_user(to_buff + page_offset, buf, page_len);
294 kunmap_local(to_buff);
295 if (ret) {
296 done = -EFAULT;
297 goto out_unlock;
298 }
299 *pos += page_len;
300 len -= page_len;
301 done += page_len;
302 buf += page_len;
303 migf->total_length += page_len;
304 }
305 out_unlock:
306 mutex_unlock(&migf->lock);
307 return done;
308 }
309
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
next reply other threads:[~2022-01-29 6:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-29 6:52 kernel test robot [this message]
2022-01-29 6:52 ` [jgunthorpe:for-yishai 12/17] drivers/vfio/pci/mlx5/main.c:254:10: warning: result of comparison of constant 9223372036854775807 with expression of type 'size_t' (aka 'unsigned int') is always false kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202201291323.OBtyolrA-lkp@intel.com \
--to=lkp@intel.com \
--cc=jgg@nvidia.com \
--cc=kbuild-all@lists.01.org \
--cc=leonro@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=yishaih@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.