[jlayton:ceph-fscrypt 32/39] include/linux/compiler_types.h:298:2: error: expected identifier or '(' before 'do'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git ceph-fscrypt
head: 6b3ebb239173120d2d62579b9d2a27a24c444a45
commit: 0737a8ffbc71d0e0334b729d50e8401cb8c3a32b [32/39] ceph: align data in pages in ceph_sync_write
config: c6x-randconfig-r011-20210209 (attached as .config)
compiler: c6x-elf-gcc (GCC) 9.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://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git/commit/...
git remote add jlayton https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git
git fetch --no-tags jlayton ceph-fscrypt
git checkout 0737a8ffbc71d0e0334b729d50e8401cb8c3a32b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=c6x
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from <command-line>:
>> include/linux/compiler_types.h:298:2: error: expected identifier or '(' before 'do'
298 | do { \
| ^~
include/linux/compiler_types.h:308:2: note: in expansion of macro '__compiletime_assert'
308 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:320:2: note: in expansion of macro '_compiletime_assert'
320 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:50:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
fs/ceph/file.c:27:1: note: in expansion of macro 'BUILD_BUG_ON'
27 | BUILD_BUG_ON(CEPH_FSCRYPT_BLOCK_SHIFT > PAGE_SHIFT);
| ^~~~~~~~~~~~
>> include/linux/compiler_types.h:302:4: error: expected identifier or '(' before 'while'
302 | } while (0)
| ^~~~~
include/linux/compiler_types.h:308:2: note: in expansion of macro '__compiletime_assert'
308 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:320:2: note: in expansion of macro '_compiletime_assert'
320 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:50:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
fs/ceph/file.c:27:1: note: in expansion of macro 'BUILD_BUG_ON'
27 | BUILD_BUG_ON(CEPH_FSCRYPT_BLOCK_SHIFT > PAGE_SHIFT);
| ^~~~~~~~~~~~
vim +298 include/linux/compiler_types.h
eb5c2d4b45e3d2 Will Deacon 2020-07-21 295
eb5c2d4b45e3d2 Will Deacon 2020-07-21 296 #ifdef __OPTIMIZE__
eb5c2d4b45e3d2 Will Deacon 2020-07-21 297 # define __compiletime_assert(condition, msg, prefix, suffix) \
eb5c2d4b45e3d2 Will Deacon 2020-07-21 @298 do { \
eb5c2d4b45e3d2 Will Deacon 2020-07-21 299 extern void prefix ## suffix(void) __compiletime_error(msg); \
eb5c2d4b45e3d2 Will Deacon 2020-07-21 300 if (!(condition)) \
eb5c2d4b45e3d2 Will Deacon 2020-07-21 301 prefix ## suffix(); \
eb5c2d4b45e3d2 Will Deacon 2020-07-21 @302 } while (0)
eb5c2d4b45e3d2 Will Deacon 2020-07-21 303 #else
eb5c2d4b45e3d2 Will Deacon 2020-07-21 304 # define __compiletime_assert(condition, msg, prefix, suffix) do { } while (0)
eb5c2d4b45e3d2 Will Deacon 2020-07-21 305 #endif
eb5c2d4b45e3d2 Will Deacon 2020-07-21 306
:::::: The code at line 298 was first introduced by commit
:::::: eb5c2d4b45e3d2d5d052ea6b8f1463976b1020d5 compiler.h: Move compiletime_assert() macros into compiler_types.h
:::::: TO: Will Deacon <will(a)kernel.org>
:::::: CC: Will Deacon <will(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
[kbuild] [bcache:for-next 8/19] drivers/md/bcache/nvm-pages.c:159:4: warning: Either the condition '!extents' is redundant or there is possible null pointer dereference: extents.
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache.git for-next
head: 78729af1b480ca5a3edb9547b97b59ed3dd72440
commit: 384227b99f413137d2b0548c364153690be8cbd1 [8/19] bcache: initialize the nvm pages allocator
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
In file included from drivers/md/bcache/nvm-pages.c:
>> drivers/md/bcache/nvm-pages.c:159:4: warning: Either the condition '!extents' is redundant or there is possible null pointer dereference: extents. [nullPointerRedundantCheck]
extents->ns = only_set->nss[j];
^
drivers/md/bcache/nvm-pages.c:169:10: note: Assuming that condition '!extents' is not redundant
if (!extents) {
^
drivers/md/bcache/nvm-pages.c:159:4: note: Null pointer dereference
extents->ns = only_set->nss[j];
^
vim +159 drivers/md/bcache/nvm-pages.c
384227b99f4131 Qiaowei Ren 2021-02-08 115 static int init_owner_info(struct bch_nvm_namespace *ns)
384227b99f4131 Qiaowei Ren 2021-02-08 116 {
384227b99f4131 Qiaowei Ren 2021-02-08 117 struct bch_owner_list_head *owner_list_head;
384227b99f4131 Qiaowei Ren 2021-02-08 118 struct bch_nvm_pages_owner_head *owner_head;
384227b99f4131 Qiaowei Ren 2021-02-08 119 struct bch_nvm_pgalloc_recs *nvm_pgalloc_recs;
384227b99f4131 Qiaowei Ren 2021-02-08 120 struct bch_owner_list *owner_list;
384227b99f4131 Qiaowei Ren 2021-02-08 121 struct bch_nvm_alloced_recs *extents;
384227b99f4131 Qiaowei Ren 2021-02-08 122 struct bch_extent *extent;
384227b99f4131 Qiaowei Ren 2021-02-08 123 u32 i, j, k;
384227b99f4131 Qiaowei Ren 2021-02-08 124
384227b99f4131 Qiaowei Ren 2021-02-08 125 owner_list_head = (struct bch_owner_list_head *)
384227b99f4131 Qiaowei Ren 2021-02-08 126 (ns->kaddr + BCH_NVM_PAGES_OWNER_LIST_HEAD_OFFSET);
384227b99f4131 Qiaowei Ren 2021-02-08 127
384227b99f4131 Qiaowei Ren 2021-02-08 128 mutex_lock(&only_set->lock);
384227b99f4131 Qiaowei Ren 2021-02-08 129 only_set->owner_list_size = owner_list_head->size;
384227b99f4131 Qiaowei Ren 2021-02-08 130 only_set->owner_list_used = owner_list_head->used;
384227b99f4131 Qiaowei Ren 2021-02-08 131
384227b99f4131 Qiaowei Ren 2021-02-08 132 for (i = 0; i < owner_list_head->used; i++) {
384227b99f4131 Qiaowei Ren 2021-02-08 133 owner_head = &owner_list_head->heads[i];
384227b99f4131 Qiaowei Ren 2021-02-08 134 owner_list = alloc_owner_list(owner_head->uuid, owner_head->label,
384227b99f4131 Qiaowei Ren 2021-02-08 135 only_set->total_namespaces_nr);
384227b99f4131 Qiaowei Ren 2021-02-08 136 if (!owner_list) {
384227b99f4131 Qiaowei Ren 2021-02-08 137 mutex_unlock(&only_set->lock);
384227b99f4131 Qiaowei Ren 2021-02-08 138 return -ENOMEM;
384227b99f4131 Qiaowei Ren 2021-02-08 139 }
384227b99f4131 Qiaowei Ren 2021-02-08 140
384227b99f4131 Qiaowei Ren 2021-02-08 141 for (j = 0; j < only_set->total_namespaces_nr; j++) {
384227b99f4131 Qiaowei Ren 2021-02-08 142 if (!only_set->nss[j] || !owner_head->recs[j])
384227b99f4131 Qiaowei Ren 2021-02-08 143 continue;
384227b99f4131 Qiaowei Ren 2021-02-08 144
384227b99f4131 Qiaowei Ren 2021-02-08 145 nvm_pgalloc_recs = (struct bch_nvm_pgalloc_recs *)
384227b99f4131 Qiaowei Ren 2021-02-08 146 ((long)owner_head->recs[j] + ns->kaddr);
384227b99f4131 Qiaowei Ren 2021-02-08 147 if (memcmp(nvm_pgalloc_recs->magic, bch_nvm_pages_pgalloc_magic, 16)) {
384227b99f4131 Qiaowei Ren 2021-02-08 148 pr_info("invalid bch_nvmpages_pgalloc_magic\n");
384227b99f4131 Qiaowei Ren 2021-02-08 149 mutex_unlock(&only_set->lock);
384227b99f4131 Qiaowei Ren 2021-02-08 150 return -EINVAL;
384227b99f4131 Qiaowei Ren 2021-02-08 151 }
384227b99f4131 Qiaowei Ren 2021-02-08 152
384227b99f4131 Qiaowei Ren 2021-02-08 153 extents = kzalloc(sizeof(*extents), GFP_KERNEL);
384227b99f4131 Qiaowei Ren 2021-02-08 154 if (!extents) {
384227b99f4131 Qiaowei Ren 2021-02-08 155 mutex_unlock(&only_set->lock);
384227b99f4131 Qiaowei Ren 2021-02-08 156 return -ENOMEM;
384227b99f4131 Qiaowei Ren 2021-02-08 157 }
384227b99f4131 Qiaowei Ren 2021-02-08 158
384227b99f4131 Qiaowei Ren 2021-02-08 @159 extents->ns = only_set->nss[j];
384227b99f4131 Qiaowei Ren 2021-02-08 160 INIT_LIST_HEAD(&extents->extent_head);
384227b99f4131 Qiaowei Ren 2021-02-08 161 owner_list->alloced_recs[j] = extents;
384227b99f4131 Qiaowei Ren 2021-02-08 162
384227b99f4131 Qiaowei Ren 2021-02-08 163 do {
384227b99f4131 Qiaowei Ren 2021-02-08 164 struct bch_pgalloc_rec *rec;
384227b99f4131 Qiaowei Ren 2021-02-08 165
384227b99f4131 Qiaowei Ren 2021-02-08 166 for (k = 0; k < nvm_pgalloc_recs->used; k++) {
384227b99f4131 Qiaowei Ren 2021-02-08 167 rec = &nvm_pgalloc_recs->recs[k];
384227b99f4131 Qiaowei Ren 2021-02-08 168 extent = kzalloc(sizeof(*extent), GFP_KERNEL);
384227b99f4131 Qiaowei Ren 2021-02-08 169 if (!extents) {
^^^^^^^
This should be "extent" singular.
384227b99f4131 Qiaowei Ren 2021-02-08 170 mutex_unlock(&only_set->lock);
384227b99f4131 Qiaowei Ren 2021-02-08 171 return -ENOMEM;
384227b99f4131 Qiaowei Ren 2021-02-08 172 }
384227b99f4131 Qiaowei Ren 2021-02-08 173 extent->kaddr = nvm_pgoff_to_vaddr(extents->ns, rec->pgoff);
384227b99f4131 Qiaowei Ren 2021-02-08 174 extent->nr = rec->nr;
384227b99f4131 Qiaowei Ren 2021-02-08 175 list_add_tail(&extent->list, &extents->extent_head);
384227b99f4131 Qiaowei Ren 2021-02-08 176 }
384227b99f4131 Qiaowei Ren 2021-02-08 177 extents->nr += nvm_pgalloc_recs->used;
384227b99f4131 Qiaowei Ren 2021-02-08 178
384227b99f4131 Qiaowei Ren 2021-02-08 179 if (nvm_pgalloc_recs->next) {
384227b99f4131 Qiaowei Ren 2021-02-08 180 nvm_pgalloc_recs = (struct bch_nvm_pgalloc_recs *)
384227b99f4131 Qiaowei Ren 2021-02-08 181 ((long)nvm_pgalloc_recs->next + ns->kaddr);
384227b99f4131 Qiaowei Ren 2021-02-08 182 if (memcmp(nvm_pgalloc_recs->magic,
384227b99f4131 Qiaowei Ren 2021-02-08 183 bch_nvm_pages_pgalloc_magic, 16)) {
384227b99f4131 Qiaowei Ren 2021-02-08 184 pr_info("invalid bch_nvmpages_pgalloc_magic\n");
384227b99f4131 Qiaowei Ren 2021-02-08 185 mutex_unlock(&only_set->lock);
384227b99f4131 Qiaowei Ren 2021-02-08 186 return -EINVAL;
384227b99f4131 Qiaowei Ren 2021-02-08 187 }
384227b99f4131 Qiaowei Ren 2021-02-08 188 } else
384227b99f4131 Qiaowei Ren 2021-02-08 189 nvm_pgalloc_recs = NULL;
384227b99f4131 Qiaowei Ren 2021-02-08 190 } while (nvm_pgalloc_recs);
384227b99f4131 Qiaowei Ren 2021-02-08 191 }
384227b99f4131 Qiaowei Ren 2021-02-08 192 only_set->owner_lists[i] = owner_list;
384227b99f4131 Qiaowei Ren 2021-02-08 193 owner_list->nvm_set = only_set;
384227b99f4131 Qiaowei Ren 2021-02-08 194 }
384227b99f4131 Qiaowei Ren 2021-02-08 195 mutex_unlock(&only_set->lock);
384227b99f4131 Qiaowei Ren 2021-02-08 196
384227b99f4131 Qiaowei Ren 2021-02-08 197 return 0;
384227b99f4131 Qiaowei Ren 2021-02-08 198 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org
1 year, 7 months
[peterz-queue:mm/apply-to-page-range 4/6] mm/memory.c:2582:2: error: expected ',' or ';' before 'return'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git mm/apply-to-page-range
head: c7e0ff9c0e75727aca201140e679ffcfcc3155f0
commit: 6734b686b6bb06054ae6c380034b15b4dc3c86ac [4/6] mm: Introduce verify_page_range()
config: x86_64-rhel (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?...
git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue mm/apply-to-page-range
git checkout 6734b686b6bb06054ae6c380034b15b4dc3c86ac
# save the attached .config to linux build tree
make 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 errors (new ones prefixed by >>):
mm/memory.c: In function 'verify_page_range':
>> mm/memory.c:2582:2: error: expected ',' or ';' before 'return'
2582 | return apply_to_page_range(mm, addr, size, vpr_fn, &vpr);
| ^~~~~~
mm/memory.c:2578:18: warning: unused variable 'vpr' [-Wunused-variable]
2578 | struct vpr_data vpr = {
| ^~~
mm/memory.c:2583:1: error: control reaches end of non-void function [-Werror=return-type]
2583 | }
| ^
At top level:
mm/memory.c:2567:12: warning: 'vpr_fn' defined but not used [-Wunused-function]
2567 | static int vpr_fn(pte_t *pte, unsigned long addr, void *data)
| ^~~~~~
cc1: some warnings being treated as errors
vim +2582 mm/memory.c
2572
2573 int verify_page_range(struct mm_struct *mm,
2574 unsigned long addr, unsigned long size,
2575 int (*fn)(pte_t pte, unsigned long addr, void *data),
2576 void *data)
2577 {
2578 struct vpr_data vpr = {
2579 .fn = fn,
2580 .data = data,
2581 }
> 2582 return apply_to_page_range(mm, addr, size, vpr_fn, &vpr);
2583 }
2584 EXPORT_SYMBOL_GPL(verify_page_range);
2585
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
[nsaenz-linux-rpi:v3d-enable-v2 9566/9840] mm/cma.c:504:31: warning: format specifies type 'size_t' (aka 'unsigned int') but the argument has type 'unsigned long'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/nsaenz/linux-rpi.git v3d-enable-v2
head: 7b81f59eac536dd4cbe3eab95904e255f5b291e5
commit: cc4ec2eab7474381e57d4bbcf3c04595a729859b [9566/9840] mm: cma: print region name on failure
config: mips-randconfig-r036-20210209 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project c9439ca36342fb6013187d0a69aef92736951476)
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 mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/nsaenz/linux-rpi.git/comm...
git remote add nsaenz-linux-rpi https://git.kernel.org/pub/scm/linux/kernel/git/nsaenz/linux-rpi.git
git fetch --no-tags nsaenz-linux-rpi v3d-enable-v2
git checkout cc4ec2eab7474381e57d4bbcf3c04595a729859b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips
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 >>):
>> mm/cma.c:504:31: warning: format specifies type 'size_t' (aka 'unsigned int') but the argument has type 'unsigned long' [-Wformat]
__func__, cma->name, cma->count, ret);
^~~~~~~~~~
include/linux/printk.h:343:33: note: expanded from macro 'pr_err'
printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
1 warning generated.
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for SSB_EMBEDDED
Depends on SSB && SSB_DRIVER_MIPS && SSB_PCICORE_HOSTMODE
Selected by
- BCM47XX_SSB && BCM47XX
vim +504 mm/cma.c
415
416 /**
417 * cma_alloc() - allocate pages from contiguous area
418 * @cma: Contiguous memory region for which the allocation is performed.
419 * @count: Requested number of pages.
420 * @align: Requested alignment of pages (in PAGE_SIZE order).
421 * @no_warn: Avoid printing message about failed allocation
422 *
423 * This function allocates part of contiguous memory on specific
424 * contiguous memory area.
425 */
426 struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align,
427 bool no_warn)
428 {
429 unsigned long mask, offset;
430 unsigned long pfn = -1;
431 unsigned long start = 0;
432 unsigned long bitmap_maxno, bitmap_no, bitmap_count;
433 size_t i;
434 struct page *page = NULL;
435 int ret = -ENOMEM;
436
437 if (!cma || !cma->count || !cma->bitmap)
438 return NULL;
439
440 pr_debug("%s(cma %p, count %zu, align %d)\n", __func__, (void *)cma,
441 count, align);
442
443 if (!count)
444 return NULL;
445
446 mask = cma_bitmap_aligned_mask(cma, align);
447 offset = cma_bitmap_aligned_offset(cma, align);
448 bitmap_maxno = cma_bitmap_maxno(cma);
449 bitmap_count = cma_bitmap_pages_to_bits(cma, count);
450
451 if (bitmap_count > bitmap_maxno)
452 return NULL;
453
454 for (;;) {
455 mutex_lock(&cma->lock);
456 bitmap_no = bitmap_find_next_zero_area_off(cma->bitmap,
457 bitmap_maxno, start, bitmap_count, mask,
458 offset);
459 if (bitmap_no >= bitmap_maxno) {
460 mutex_unlock(&cma->lock);
461 break;
462 }
463 bitmap_set(cma->bitmap, bitmap_no, bitmap_count);
464 /*
465 * It's safe to drop the lock here. We've marked this region for
466 * our exclusive use. If the migration fails we will take the
467 * lock again and unmark it.
468 */
469 mutex_unlock(&cma->lock);
470
471 pfn = cma->base_pfn + (bitmap_no << cma->order_per_bit);
472 ret = alloc_contig_range(pfn, pfn + count, MIGRATE_CMA,
473 GFP_KERNEL | (no_warn ? __GFP_NOWARN : 0));
474
475 if (ret == 0) {
476 page = pfn_to_page(pfn);
477 break;
478 }
479
480 cma_clear_bitmap(cma, pfn, count);
481 if (ret != -EBUSY)
482 break;
483
484 pr_debug("%s(): memory range at %p is busy, retrying\n",
485 __func__, pfn_to_page(pfn));
486 /* try again with a bit different memory target */
487 start = bitmap_no + mask + 1;
488 }
489
490 trace_cma_alloc(pfn, page, count, align);
491
492 /*
493 * CMA can allocate multiple page blocks, which results in different
494 * blocks being marked with different tags. Reset the tags to ignore
495 * those page blocks.
496 */
497 if (page) {
498 for (i = 0; i < count; i++)
499 page_kasan_tag_reset(page + i);
500 }
501
502 if (ret && !no_warn) {
503 pr_err("%s: %s: alloc failed, req-size: %zu pages, ret: %d\n",
> 504 __func__, cma->name, cma->count, ret);
505 cma_debug_show_areas(cma);
506 }
507
508 pr_debug("%s(): returned %p\n", __func__, page);
509 return page;
510 }
511
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
[android-common:android12-5.10 3/5] drivers/dma-buf/heaps/page_pool.c:242:5: warning: no previous prototype for 'dmabuf_page_pool_init_shrinker'
by kernel test robot
tree: https://android.googlesource.com/kernel/common android12-5.10
head: d50b67ac7551b81ae82e70c6f2811073ba3575ba
commit: 23762f02e172f146ccd160e36ed43483f2304aaf [3/5] ANDROID: dma-buf: system_heap: Add pagepool support to system heap
config: i386-randconfig-s002-20210209 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-215-g0fb77bb6-dirty
git remote add android-common https://android.googlesource.com/kernel/common
git fetch --no-tags android-common android12-5.10
git checkout 23762f02e172f146ccd160e36ed43483f2304aaf
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
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/dma-buf/heaps/page_pool.c:242:5: warning: no previous prototype for 'dmabuf_page_pool_init_shrinker' [-Wmissing-prototypes]
242 | int dmabuf_page_pool_init_shrinker(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"sparse warnings: (new ones prefixed by >>)"
>> drivers/dma-buf/heaps/page_pool.c:235:17: sparse: sparse: symbol 'pool_shrinker' was not declared. Should it be static?
>> drivers/dma-buf/heaps/page_pool.c:242:5: sparse: sparse: symbol 'dmabuf_page_pool_init_shrinker' was not declared. Should it be static?
Please review and possibly fold the followup patch.
vim +/dmabuf_page_pool_init_shrinker +242 drivers/dma-buf/heaps/page_pool.c
e7dac4c3231c0e John Stultz 2020-10-02 234
e7dac4c3231c0e John Stultz 2020-10-02 @235 struct shrinker pool_shrinker = {
e7dac4c3231c0e John Stultz 2020-10-02 236 .count_objects = dmabuf_page_pool_shrink_count,
e7dac4c3231c0e John Stultz 2020-10-02 237 .scan_objects = dmabuf_page_pool_shrink_scan,
e7dac4c3231c0e John Stultz 2020-10-02 238 .seeks = DEFAULT_SEEKS,
e7dac4c3231c0e John Stultz 2020-10-02 239 .batch = 0,
e7dac4c3231c0e John Stultz 2020-10-02 240 };
e7dac4c3231c0e John Stultz 2020-10-02 241
e7dac4c3231c0e John Stultz 2020-10-02 @242 int dmabuf_page_pool_init_shrinker(void)
:::::: The code at line 242 was first introduced by commit
:::::: e7dac4c3231c0e8adeef8dbb732b2cde7c162b14 ANDROID: dma-buf: heaps: Add a shrinker controlled page pool
:::::: TO: John Stultz <john.stultz(a)linaro.org>
:::::: CC: Hridya Valsaraju <hridya(a)google.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org
1 year, 7 months
[jlayton:ceph-fscrypt 39/39] fs/ceph/file.c:1518:14: error: 'struct ceph_inode_info' has no member named 'vino'; did you mean
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git ceph-fscrypt
head: 6b3ebb239173120d2d62579b9d2a27a24c444a45
commit: 6b3ebb239173120d2d62579b9d2a27a24c444a45 [39/39] WIP: ceph add read/modify/write
config: ia64-randconfig-s032-20210209 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-215-g0fb77bb6-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git/commit/...
git remote add jlayton https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git
git fetch --no-tags jlayton ceph-fscrypt
git checkout 6b3ebb239173120d2d62579b9d2a27a24c444a45
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=ia64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from arch/ia64/include/asm/pgtable.h:154,
from include/linux/pgtable.h:6,
from arch/ia64/include/asm/uaccess.h:40,
from include/linux/uaccess.h:11,
from include/linux/sched/task.h:11,
from include/linux/sched/signal.h:9,
from include/linux/rcuwait.h:6,
from include/linux/percpu-rwsem.h:7,
from include/linux/fs.h:33,
from include/linux/namei.h:5,
from fs/ceph/file.c:10:
arch/ia64/include/asm/mmu_context.h: In function 'reload_context':
arch/ia64/include/asm/mmu_context.h:127:41: warning: variable 'old_rr4' set but not used [-Wunused-but-set-variable]
127 | unsigned long rr0, rr1, rr2, rr3, rr4, old_rr4;
| ^~~~~~~
In file included from <command-line>:
fs/ceph/file.c: At top level:
include/linux/compiler_types.h:298:2: error: expected identifier or '(' before 'do'
298 | do { \
| ^~
include/linux/compiler_types.h:308:2: note: in expansion of macro '__compiletime_assert'
308 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:320:2: note: in expansion of macro '_compiletime_assert'
320 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:50:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
fs/ceph/file.c:27:1: note: in expansion of macro 'BUILD_BUG_ON'
27 | BUILD_BUG_ON(CEPH_FSCRYPT_BLOCK_SHIFT > PAGE_SHIFT);
| ^~~~~~~~~~~~
include/linux/compiler_types.h:302:4: error: expected identifier or '(' before 'while'
302 | } while (0)
| ^~~~~
include/linux/compiler_types.h:308:2: note: in expansion of macro '__compiletime_assert'
308 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:320:2: note: in expansion of macro '_compiletime_assert'
320 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:50:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
fs/ceph/file.c:27:1: note: in expansion of macro 'BUILD_BUG_ON'
27 | BUILD_BUG_ON(CEPH_FSCRYPT_BLOCK_SHIFT > PAGE_SHIFT);
| ^~~~~~~~~~~~
fs/ceph/file.c: In function 'ceph_sync_read':
fs/ceph/file.c:927:37: error: invalid type argument of unary '*' (have 'u64' {aka 'long long unsigned int'})
927 | fscrypt_adjust_off_and_len(inode, *read_off, *read_len);
| ^~~~~~~~~
fs/ceph/file.c:927:48: error: invalid type argument of unary '*' (have 'u64' {aka 'long long unsigned int'})
927 | fscrypt_adjust_off_and_len(inode, *read_off, *read_len);
| ^~~~~~~~~
fs/ceph/file.c: In function 'ceph_sync_write':
>> fs/ceph/file.c:1518:14: error: 'struct ceph_inode_info' has no member named 'vino'; did you mean 'i_vino'?
1518 | ci->vino, pos, &len, 0, 1,
| ^~~~
| i_vino
>> fs/ceph/file.c:1532:14: error: 'write_off' undeclared (first use in this function); did you mean 'write_len'?
1532 | page_off = write_off & ~PAGE_MASK;
| ^~~~~~~~~
| write_len
fs/ceph/file.c:1532:14: note: each undeclared identifier is reported only once for each function it appears in
>> fs/ceph/file.c:1548:33: error: 'osdc' undeclared (first use in this function)
1548 | rreq = ceph_osdc_new_request(osdc, &ci->i_layout,
| ^~~~
>> fs/ceph/file.c:1560:38: error: passing argument 1 of 'osd_req_op_extent_osd_data_pages' from incompatible pointer type [-Werror=incompatible-pointer-types]
1560 | osd_req_op_extent_osd_data_pages(rreq, 0, pages,
| ^~~~
| |
| struct ceph_osdc_new_request *
In file included from include/linux/ceph/libceph.h:24,
from fs/ceph/super.h:22,
from fs/ceph/file.c:16:
include/linux/ceph/osd_client.h:442:46: note: expected 'struct ceph_osd_request *' but argument is of type 'struct ceph_osdc_new_request *'
442 | extern void osd_req_op_extent_osd_data_pages(struct ceph_osd_request *,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
>> fs/ceph/file.c:1566:3: error: expected expression before '}' token
1566 | }
| ^
cc1: some warnings being treated as errors
vim +1518 fs/ceph/file.c
1455
1456 /*
1457 * Synchronous write, straight from __user pointer or user pages.
1458 *
1459 * If write spans object boundary, just do multiple writes. (For a
1460 * correct atomic write, we should e.g. take write locks on all
1461 * objects, rollback on failure, etc.)
1462 */
1463 static ssize_t
1464 ceph_sync_write(struct kiocb *iocb, struct iov_iter *from, loff_t pos,
1465 struct ceph_snap_context *snapc)
1466 {
1467 struct file *file = iocb->ki_filp;
1468 struct inode *inode = file_inode(file);
1469 struct ceph_inode_info *ci = ceph_inode(inode);
1470 struct ceph_fs_client *fsc = ceph_inode_to_client(inode);
1471 struct ceph_osd_request *req;
1472 struct page **pages;
1473 u64 len;
1474 int num_pages;
1475 int written = 0;
1476 int flags;
1477 int ret;
1478 bool check_caps = false;
1479 struct timespec64 mtime = current_time(inode);
1480 size_t count = iov_iter_count(from);
1481 size_t off;
1482
1483 if (ceph_snap(file_inode(file)) != CEPH_NOSNAP)
1484 return -EROFS;
1485
1486 dout("sync_write on file %p %lld~%u snapc %p seq %lld\n",
1487 file, pos, (unsigned)count, snapc, snapc->seq);
1488
1489 ret = filemap_write_and_wait_range(inode->i_mapping,
1490 pos, pos + count - 1);
1491 if (ret < 0)
1492 return ret;
1493
1494 ret = invalidate_inode_pages2_range(inode->i_mapping,
1495 pos >> PAGE_SHIFT,
1496 (pos + count - 1) >> PAGE_SHIFT);
1497 if (ret < 0)
1498 dout("invalidate_inode_pages2_range returned %d\n", ret);
1499
1500 flags = /* CEPH_OSD_FLAG_ORDERSNAP | */ CEPH_OSD_FLAG_WRITE;
1501
1502 /* FIXME: temporary hack until we can do a proper RMW cycle */
1503 if (IS_ENCRYPTED(inode)) {
1504 len = iov_iter_count(from);
1505 if ((pos & ~CEPH_FSCRYPT_BLOCK_MASK) || (len & ~CEPH_FSCRYPT_BLOCK_MASK))
1506 return -EINVAL;
1507 }
1508
1509 while ((len = iov_iter_count(from)) > 0) {
1510 size_t left;
1511 size_t page_off;
1512 int n;
1513 u64 baseblock = pos >> CEPH_FSCRYPT_BLOCK_SHIFT;
1514 u64 write_pos = pos;
1515 u64 write_len;
1516
1517 req = ceph_osdc_new_request(&fsc->client->osdc, &ci->i_layout,
> 1518 ci->vino, pos, &len, 0, 1,
1519 CEPH_OSD_OP_WRITE, flags, snapc,
1520 ci->i_truncate_seq,
1521 ci->i_truncate_size,
1522 false);
1523 if (IS_ERR(req)) {
1524 ret = PTR_ERR(req);
1525 break;
1526 }
1527
1528 write_len = len;
1529 fscrypt_adjust_off_and_len(inode, &write_pos, &write_len);
1530
1531 num_pages = calc_pages_for(write_pos, write_len);
> 1532 page_off = write_off & ~PAGE_MASK;
1533 pages = ceph_alloc_page_vector(num_pages, GFP_KERNEL);
1534 if (IS_ERR(pages)) {
1535 ret = PTR_ERR(pages);
1536 goto out;
1537 }
1538
1539 /* Do we need to preload the pages? */
1540 if (pos != write_pos || len != write_len) {
1541 struct ceph_osdc_new_request *rreq;
1542 u64 read_off = write_off;
1543 u64 read_len = write_len;
1544
1545 /* We should only need to do this for encrypted inodes */
1546 WARN_ON_ONCE(!IS_ENCRYPTED(inode));
1547
> 1548 rreq = ceph_osdc_new_request(osdc, &ci->i_layout,
1549 ci->i_vino, read_off, &read_len, 0, 1,
1550 CEPH_OSD_OP_READ, CEPH_OSD_FLAG_READ,
1551 NULL, ci->i_truncate_seq,
1552 ci->i_truncate_size, false);
1553 if (IS_ERR(rreq)) {
1554 ret = PTR_ERR(rreq);
1555 break;
1556 }
1557
1558 /* Add extent for first block? */
1559 if (pos != write_pos)
> 1560 osd_req_op_extent_osd_data_pages(rreq, 0, pages,
1561 CEPH_FSCRYPT_BLOCK_SIZE,
1562 page_off, false, false);
1563
1564 /* Add extent for last block */
1565 if (len != write_len)
> 1566 }
1567
1568 left = len;
1569 off = pos & ~CEPH_FSCRYPT_BLOCK_MASK;
1570 for (n = 0; n < num_pages; n++) {
1571 size_t plen = min_t(size_t, left, CEPH_FSCRYPT_BLOCK_SIZE - off);
1572 ret = copy_page_from_iter(pages[n], off, plen, from);
1573 off = 0;
1574 if (ret != plen) {
1575 ret = -EFAULT;
1576 break;
1577 }
1578 left -= ret;
1579 if (IS_ENCRYPTED(inode)) {
1580 ret = fscrypt_encrypt_block_inplace(inode, pages[n],
1581 CEPH_FSCRYPT_BLOCK_SIZE, 0,
1582 baseblock + n, GFP_KERNEL);
1583 if (ret)
1584 break;
1585 }
1586 }
1587
1588 if (ret < 0) {
1589 ceph_release_page_vector(pages, num_pages);
1590 goto out;
1591 }
1592
1593 req->r_inode = inode;
1594
1595 osd_req_op_extent_osd_data_pages(req, 0, pages, len,
1596 pos & ~CEPH_FSCRYPT_BLOCK_MASK,
1597 false, true);
1598
1599 req->r_mtime = mtime;
1600 ret = ceph_osdc_start_request(&fsc->client->osdc, req, false);
1601 if (!ret)
1602 ret = ceph_osdc_wait_request(&fsc->client->osdc, req);
1603
1604 ceph_update_write_latency(&fsc->mdsc->metric, req->r_start_latency,
1605 req->r_end_latency, ret);
1606 out:
1607 ceph_osdc_put_request(req);
1608 if (ret != 0) {
1609 ceph_set_error_write(ci);
1610 break;
1611 }
1612
1613 ceph_clear_error_write(ci);
1614 pos += len;
1615 written += len;
1616 if (pos > i_size_read(inode)) {
1617 check_caps = ceph_inode_set_size(inode, pos);
1618 if (check_caps)
1619 ceph_check_caps(ceph_inode(inode),
1620 CHECK_CAPS_AUTHONLY,
1621 NULL);
1622 }
1623
1624 }
1625
1626 if (ret != -EOLDSNAPC && written > 0) {
1627 ret = written;
1628 iocb->ki_pos = pos;
1629 }
1630 return ret;
1631 }
1632
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
[xlnx:master 9663/10510] drivers/net/ethernet/xilinx/xilinx_axienet_main.c:2948 axienet_probe() warn: missing error code 'ret'
by Dan Carpenter
tree: https://github.com/Xilinx/linux-xlnx master
head: d3774573d5a9700273bd0c3ff82af157107f7fa6
commit: 0f447249ba48721e24292b1ddacf1b4b4e21d9a7 [9663/10510] net: axienet: added multichannel DMA support
config: i386-randconfig-m021-20210209 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/net/ethernet/xilinx/xilinx_axienet_main.c:2948 axienet_probe() warn: missing error code 'ret'
Old smatch warnings:
drivers/net/ethernet/xilinx/xilinx_axienet_main.c:204 axienet_dma_bd_init() error: uninitialized symbol 'ret'.
vim +/ret +2948 drivers/net/ethernet/xilinx/xilinx_axienet_main.c
6a8544f2f4d900 Appana Durga Kedareswara Rao 2020-01-24 2931 of_node_put(np);
6a8544f2f4d900 Appana Durga Kedareswara Rao 2020-01-24 2932 #endif
0f447249ba4872 Saurabh Sengar 2020-01-24 2933 if (!slave) {
0f447249ba4872 Saurabh Sengar 2020-01-24 2934 #ifdef CONFIG_AXIENET_HAS_MCDMA
0f447249ba4872 Saurabh Sengar 2020-01-24 2935 ret = axienet_mcdma_probe(pdev, lp, ndev);
0f447249ba4872 Saurabh Sengar 2020-01-24 2936 #else
0f447249ba4872 Saurabh Sengar 2020-01-24 2937 ret = axienet_dma_probe(pdev, ndev);
0f447249ba4872 Saurabh Sengar 2020-01-24 2938 #endif
b482f0a0aa9973 Radhey Shyam Pandey 2020-01-24 2939 if (ret) {
0f447249ba4872 Saurabh Sengar 2020-01-24 2940 pr_err("Getting DMA resource failed\n");
46aa27df885321 Srikanth Thokala 2015-05-05 2941 goto free_netdev;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 2942 }
9e8ce9d565663f Appana Durga Kedareswara Rao 2020-01-24 2943
0f447249ba4872 Saurabh Sengar 2020-01-24 2944 if (dma_set_mask_and_coherent(lp->dev, DMA_BIT_MASK(lp->dma_mask)) != 0) {
0f447249ba4872 Saurabh Sengar 2020-01-24 2945 dev_warn(&pdev->dev, "default to %d-bit dma mask\n", XAE_DMA_MASK_MIN);
0f447249ba4872 Saurabh Sengar 2020-01-24 2946 if (dma_set_mask_and_coherent(lp->dev, DMA_BIT_MASK(XAE_DMA_MASK_MIN)) != 0) {
0f447249ba4872 Saurabh Sengar 2020-01-24 2947 dev_err(&pdev->dev, "dma_set_mask_and_coherent failed, aborting\n");
46aa27df885321 Srikanth Thokala 2015-05-05 @2948 goto free_netdev;
ret is not set on this error path.
8a3b7a252dca9f Daniel Borkmann 2012-01-19 2949 }
0f447249ba4872 Saurabh Sengar 2020-01-24 2950 }
57b6ef54c85dd8 Appana Durga Kedareswara Rao 2020-01-24 2951
b5d3f74c95f046 Appana Durga Kedareswara Rao 2020-01-24 2952 ret = axienet_dma_clk_init(pdev);
b5d3f74c95f046 Appana Durga Kedareswara Rao 2020-01-24 2953 if (ret) {
b5d3f74c95f046 Appana Durga Kedareswara Rao 2020-01-24 2954 if (ret != -EPROBE_DEFER)
b5d3f74c95f046 Appana Durga Kedareswara Rao 2020-01-24 2955 dev_err(&pdev->dev, "DMA clock init failed %d\n", ret);
b5d3f74c95f046 Appana Durga Kedareswara Rao 2020-01-24 2956 goto free_netdev;
b5d3f74c95f046 Appana Durga Kedareswara Rao 2020-01-24 2957 }
0f447249ba4872 Saurabh Sengar 2020-01-24 2958 }
b5d3f74c95f046 Appana Durga Kedareswara Rao 2020-01-24 2959
b5d3f74c95f046 Appana Durga Kedareswara Rao 2020-01-24 2960 ret = axienet_clk_init(pdev, &lp->aclk, &lp->eth_sclk,
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months