* lib/iov_iter.c:1298 want_pages_array() warn: ambiguous units merge 'count' 'page' or 'array_size'
@ 2023-05-10 8:07 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2023-05-10 8:07 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp, Dan Carpenter
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Al Viro <viro@zeniv.linux.org.uk>
CC: Jeff Layton <jlayton@kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 16a8829130ca22666ac6236178a6233208d425c3
commit: 3cf42da327f26eb4461864dd64812345b37f4fd9 iov_iter: saner helper for page array allocation
date: 9 months ago
:::::: branch date: 15 hours ago
:::::: commit date: 9 months ago
config: x86_64-randconfig-m001 (https://download.01.org/0day-ci/archive/20230510/202305101654.CPCc9h1a-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Link: https://lore.kernel.org/r/202305101654.CPCc9h1a-lkp@intel.com/
smatch warnings:
lib/iov_iter.c:1298 want_pages_array() warn: ambiguous units merge 'count' 'page' or 'array_size'
lib/iov_iter.c:1298 want_pages_array() warn: ambiguous units merge 'count' 'array_size' or 'page'
vim +1298 lib/iov_iter.c
357f435d8a0d32 Al Viro 2016-04-08 1286
3cf42da327f26e Al Viro 2022-06-17 1287 static int want_pages_array(struct page ***res, size_t size,
3cf42da327f26e Al Viro 2022-06-17 1288 size_t start, unsigned int maxpages)
acbdeb8320b0a4 Al Viro 2022-06-17 1289 {
3cf42da327f26e Al Viro 2022-06-17 1290 unsigned int count = DIV_ROUND_UP(size + start, PAGE_SIZE);
3cf42da327f26e Al Viro 2022-06-17 1291
3cf42da327f26e Al Viro 2022-06-17 1292 if (count > maxpages)
3cf42da327f26e Al Viro 2022-06-17 1293 count = maxpages;
3cf42da327f26e Al Viro 2022-06-17 1294 WARN_ON(!count); // caller should've prevented that
3cf42da327f26e Al Viro 2022-06-17 1295 if (!*res) {
3cf42da327f26e Al Viro 2022-06-17 1296 *res = kvmalloc_array(count, sizeof(struct page *), GFP_KERNEL);
3cf42da327f26e Al Viro 2022-06-17 1297 if (!*res)
3cf42da327f26e Al Viro 2022-06-17 @1298 return 0;
3cf42da327f26e Al Viro 2022-06-17 1299 }
3cf42da327f26e Al Viro 2022-06-17 1300 return count;
acbdeb8320b0a4 Al Viro 2022-06-17 1301 }
acbdeb8320b0a4 Al Viro 2022-06-17 1302
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] 2+ messages in thread
* lib/iov_iter.c:1298 want_pages_array() warn: ambiguous units merge 'count' 'page' or 'array_size'
@ 2023-05-10 13:11 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2023-05-10 13:11 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp, Dan Carpenter
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Al Viro <viro@zeniv.linux.org.uk>
CC: Jeff Layton <jlayton@kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 16a8829130ca22666ac6236178a6233208d425c3
commit: 3cf42da327f26eb4461864dd64812345b37f4fd9 iov_iter: saner helper for page array allocation
date: 9 months ago
:::::: branch date: 20 hours ago
:::::: commit date: 9 months ago
config: x86_64-randconfig-m001 (https://download.01.org/0day-ci/archive/20230510/202305102104.SULT79lZ-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Link: https://lore.kernel.org/r/202305102104.SULT79lZ-lkp@intel.com/
smatch warnings:
lib/iov_iter.c:1298 want_pages_array() warn: ambiguous units merge 'count' 'page' or 'array_size'
lib/iov_iter.c:1298 want_pages_array() warn: ambiguous units merge 'count' 'array_size' or 'page'
vim +1298 lib/iov_iter.c
357f435d8a0d32 Al Viro 2016-04-08 1286
3cf42da327f26e Al Viro 2022-06-17 1287 static int want_pages_array(struct page ***res, size_t size,
3cf42da327f26e Al Viro 2022-06-17 1288 size_t start, unsigned int maxpages)
acbdeb8320b0a4 Al Viro 2022-06-17 1289 {
3cf42da327f26e Al Viro 2022-06-17 1290 unsigned int count = DIV_ROUND_UP(size + start, PAGE_SIZE);
3cf42da327f26e Al Viro 2022-06-17 1291
3cf42da327f26e Al Viro 2022-06-17 1292 if (count > maxpages)
3cf42da327f26e Al Viro 2022-06-17 1293 count = maxpages;
3cf42da327f26e Al Viro 2022-06-17 1294 WARN_ON(!count); // caller should've prevented that
3cf42da327f26e Al Viro 2022-06-17 1295 if (!*res) {
3cf42da327f26e Al Viro 2022-06-17 1296 *res = kvmalloc_array(count, sizeof(struct page *), GFP_KERNEL);
3cf42da327f26e Al Viro 2022-06-17 1297 if (!*res)
3cf42da327f26e Al Viro 2022-06-17 @1298 return 0;
3cf42da327f26e Al Viro 2022-06-17 1299 }
3cf42da327f26e Al Viro 2022-06-17 1300 return count;
acbdeb8320b0a4 Al Viro 2022-06-17 1301 }
acbdeb8320b0a4 Al Viro 2022-06-17 1302
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-05-10 13:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-10 13:11 lib/iov_iter.c:1298 want_pages_array() warn: ambiguous units merge 'count' 'page' or 'array_size' kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2023-05-10 8:07 kernel test robot
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.