[mcgrof-next:20211011-for-axboe-add-disk-error-handling 24/24] drivers/md/md.c:5705:2: warning: ignoring return value of function declared with 'warn_unused_result' attribute
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git 20211011-for-axboe-add-disk-error-handling
head: 53099761729ca16d3bb36db8a8cc526f4eb08f28
commit: 53099761729ca16d3bb36db8a8cc526f4eb08f28 [24/24] block: add __must_check for *add_disk*() callers
config: hexagon-randconfig-r041-20211019 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d245f2e8597bfb52c34810a328d42b990e4af1a4)
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/mcgrof/linux-next.git/com...
git remote add mcgrof-next https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git
git fetch --no-tags mcgrof-next 20211011-for-axboe-add-disk-error-handling
git checkout 53099761729ca16d3bb36db8a8cc526f4eb08f28
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=hexagon
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/md/md.c:5705:2: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
add_disk(disk);
^~~~~~~~ ~~~~
1 warning generated.
vim +/warn_unused_result +5705 drivers/md/md.c
a415c0f1062791 NeilBrown 2017-06-05 5620
efeb53c0e57213 NeilBrown 2009-01-09 5621 static int md_alloc(dev_t dev, char *name)
^1da177e4c3f41 Linus Torvalds 2005-04-16 5622 {
039b7225e6e987 NeilBrown 2017-04-12 5623 /*
039b7225e6e987 NeilBrown 2017-04-12 5624 * If dev is zero, name is the name of a device to allocate with
039b7225e6e987 NeilBrown 2017-04-12 5625 * an arbitrary minor number. It will be "md_???"
039b7225e6e987 NeilBrown 2017-04-12 5626 * If dev is non-zero it must be a device number with a MAJOR of
039b7225e6e987 NeilBrown 2017-04-12 5627 * MD_MAJOR or mdp_major. In this case, if "name" is NULL, then
039b7225e6e987 NeilBrown 2017-04-12 5628 * the device is being created by opening a node in /dev.
039b7225e6e987 NeilBrown 2017-04-12 5629 * If "name" is not NULL, the device is being created by
039b7225e6e987 NeilBrown 2017-04-12 5630 * writing to /sys/module/md_mod/parameters/new_array.
039b7225e6e987 NeilBrown 2017-04-12 5631 */
48c9c27b8bcd2a Arjan van de Ven 2006-03-27 5632 static DEFINE_MUTEX(disks_mutex);
0d809b3837a0be Christoph Hellwig 2021-04-12 5633 struct mddev *mddev;
^1da177e4c3f41 Linus Torvalds 2005-04-16 5634 struct gendisk *disk;
efeb53c0e57213 NeilBrown 2009-01-09 5635 int partitioned;
efeb53c0e57213 NeilBrown 2009-01-09 5636 int shift;
efeb53c0e57213 NeilBrown 2009-01-09 5637 int unit;
3830c62fef49f8 Greg Kroah-Hartman 2007-12-17 5638 int error ;
^1da177e4c3f41 Linus Torvalds 2005-04-16 5639
0d809b3837a0be Christoph Hellwig 2021-04-12 5640 /*
0d809b3837a0be Christoph Hellwig 2021-04-12 5641 * Wait for any previous instance of this device to be completely
0d809b3837a0be Christoph Hellwig 2021-04-12 5642 * removed (mddev_delayed_delete).
d3374825ce57ba NeilBrown 2009-01-09 5643 */
e804ac780e2f01 Tejun Heo 2010-10-15 5644 flush_workqueue(md_misc_wq);
d3374825ce57ba NeilBrown 2009-01-09 5645
48c9c27b8bcd2a Arjan van de Ven 2006-03-27 5646 mutex_lock(&disks_mutex);
0d809b3837a0be Christoph Hellwig 2021-04-12 5647 mddev = mddev_alloc(dev);
0d809b3837a0be Christoph Hellwig 2021-04-12 5648 if (IS_ERR(mddev)) {
0d809b3837a0be Christoph Hellwig 2021-04-12 5649 mutex_unlock(&disks_mutex);
0d809b3837a0be Christoph Hellwig 2021-04-12 5650 return PTR_ERR(mddev);
0d809b3837a0be Christoph Hellwig 2021-04-12 5651 }
0d809b3837a0be Christoph Hellwig 2021-04-12 5652
0d809b3837a0be Christoph Hellwig 2021-04-12 5653 partitioned = (MAJOR(mddev->unit) != MD_MAJOR);
0d809b3837a0be Christoph Hellwig 2021-04-12 5654 shift = partitioned ? MdpMinorShift : 0;
0d809b3837a0be Christoph Hellwig 2021-04-12 5655 unit = MINOR(mddev->unit) >> shift;
efeb53c0e57213 NeilBrown 2009-01-09 5656
039b7225e6e987 NeilBrown 2017-04-12 5657 if (name && !dev) {
efeb53c0e57213 NeilBrown 2009-01-09 5658 /* Need to ensure that 'name' is not a duplicate.
efeb53c0e57213 NeilBrown 2009-01-09 5659 */
fd01b88c75a718 NeilBrown 2011-10-11 5660 struct mddev *mddev2;
efeb53c0e57213 NeilBrown 2009-01-09 5661 spin_lock(&all_mddevs_lock);
efeb53c0e57213 NeilBrown 2009-01-09 5662
efeb53c0e57213 NeilBrown 2009-01-09 5663 list_for_each_entry(mddev2, &all_mddevs, all_mddevs)
efeb53c0e57213 NeilBrown 2009-01-09 5664 if (mddev2->gendisk &&
efeb53c0e57213 NeilBrown 2009-01-09 5665 strcmp(mddev2->gendisk->disk_name, name) == 0) {
efeb53c0e57213 NeilBrown 2009-01-09 5666 spin_unlock(&all_mddevs_lock);
0d809b3837a0be Christoph Hellwig 2021-04-12 5667 error = -EEXIST;
0909dc448c98ed NeilBrown 2009-07-01 5668 goto abort;
efeb53c0e57213 NeilBrown 2009-01-09 5669 }
efeb53c0e57213 NeilBrown 2009-01-09 5670 spin_unlock(&all_mddevs_lock);
^1da177e4c3f41 Linus Torvalds 2005-04-16 5671 }
039b7225e6e987 NeilBrown 2017-04-12 5672 if (name && dev)
039b7225e6e987 NeilBrown 2017-04-12 5673 /*
039b7225e6e987 NeilBrown 2017-04-12 5674 * Creating /dev/mdNNN via "newarray", so adjust hold_active.
039b7225e6e987 NeilBrown 2017-04-12 5675 */
039b7225e6e987 NeilBrown 2017-04-12 5676 mddev->hold_active = UNTIL_STOP;
8b76539823d715 NeilBrown 2009-01-09 5677
0909dc448c98ed NeilBrown 2009-07-01 5678 error = -ENOMEM;
0f1d2e0643c544 Christoph Hellwig 2021-05-21 5679 disk = blk_alloc_disk(NUMA_NO_NODE);
0f1d2e0643c544 Christoph Hellwig 2021-05-21 5680 if (!disk)
0909dc448c98ed NeilBrown 2009-07-01 5681 goto abort;
409c57f3801701 NeilBrown 2009-03-31 5682
efeb53c0e57213 NeilBrown 2009-01-09 5683 disk->major = MAJOR(mddev->unit);
^1da177e4c3f41 Linus Torvalds 2005-04-16 5684 disk->first_minor = unit << shift;
0f1d2e0643c544 Christoph Hellwig 2021-05-21 5685 disk->minors = 1 << shift;
efeb53c0e57213 NeilBrown 2009-01-09 5686 if (name)
efeb53c0e57213 NeilBrown 2009-01-09 5687 strcpy(disk->disk_name, name);
efeb53c0e57213 NeilBrown 2009-01-09 5688 else if (partitioned)
^1da177e4c3f41 Linus Torvalds 2005-04-16 5689 sprintf(disk->disk_name, "md_d%d", unit);
ce7b0f46bbf4bf Greg Kroah-Hartman 2005-06-20 5690 else
^1da177e4c3f41 Linus Torvalds 2005-04-16 5691 sprintf(disk->disk_name, "md%d", unit);
^1da177e4c3f41 Linus Torvalds 2005-04-16 5692 disk->fops = &md_fops;
^1da177e4c3f41 Linus Torvalds 2005-04-16 5693 disk->private_data = mddev;
0f1d2e0643c544 Christoph Hellwig 2021-05-21 5694
0f1d2e0643c544 Christoph Hellwig 2021-05-21 5695 mddev->queue = disk->queue;
0f1d2e0643c544 Christoph Hellwig 2021-05-21 5696 blk_set_stacking_limits(&mddev->queue->limits);
56883a7ec85f5b Jens Axboe 2016-03-30 5697 blk_queue_write_cache(mddev->queue, true, true);
92850bbd712287 NeilBrown 2008-10-21 5698 /* Allow extended partitions. This makes the
d3374825ce57ba NeilBrown 2009-01-09 5699 * 'mdp' device redundant, but we can't really
92850bbd712287 NeilBrown 2008-10-21 5700 * remove it now.
92850bbd712287 NeilBrown 2008-10-21 5701 */
92850bbd712287 NeilBrown 2008-10-21 5702 disk->flags |= GENHD_FL_EXT_DEVT;
a564e23f0f9975 Christoph Hellwig 2020-07-08 5703 disk->events |= DISK_EVENT_MEDIA_CHANGE;
^1da177e4c3f41 Linus Torvalds 2005-04-16 5704 mddev->gendisk = disk;
b0140891a8cea3 NeilBrown 2011-05-10 @5705 add_disk(disk);
b0140891a8cea3 NeilBrown 2011-05-10 5706
28dec870aaf704 Kent Overstreet 2018-06-07 5707 error = kobject_add(&mddev->kobj, &disk_to_dev(disk)->kobj, "%s", "md");
0909dc448c98ed NeilBrown 2009-07-01 5708 if (error) {
0909dc448c98ed NeilBrown 2009-07-01 5709 /* This isn't possible, but as kobject_init_and_add is marked
0909dc448c98ed NeilBrown 2009-07-01 5710 * __must_check, we must do something with the result
0909dc448c98ed NeilBrown 2009-07-01 5711 */
9d48739ef19aa8 NeilBrown 2016-11-02 5712 pr_debug("md: cannot register %s/md - name in use\n",
5e55e2f5fc95b3 NeilBrown 2007-03-26 5713 disk->disk_name);
0909dc448c98ed NeilBrown 2009-07-01 5714 error = 0;
0909dc448c98ed NeilBrown 2009-07-01 5715 }
00bcb4ac7ee7e5 NeilBrown 2010-06-01 5716 if (mddev->kobj.sd &&
00bcb4ac7ee7e5 NeilBrown 2010-06-01 5717 sysfs_create_group(&mddev->kobj, &md_bitmap_group))
9d48739ef19aa8 NeilBrown 2016-11-02 5718 pr_debug("pointless warning\n");
0909dc448c98ed NeilBrown 2009-07-01 5719 abort:
0909dc448c98ed NeilBrown 2009-07-01 5720 mutex_unlock(&disks_mutex);
00bcb4ac7ee7e5 NeilBrown 2010-06-01 5721 if (!error && mddev->kobj.sd) {
3830c62fef49f8 Greg Kroah-Hartman 2007-12-17 5722 kobject_uevent(&mddev->kobj, KOBJ_ADD);
00bcb4ac7ee7e5 NeilBrown 2010-06-01 5723 mddev->sysfs_state = sysfs_get_dirent_safe(mddev->kobj.sd, "array_state");
e1a86dbbbd6a77 Junxiao Bi 2020-07-14 5724 mddev->sysfs_level = sysfs_get_dirent_safe(mddev->kobj.sd, "level");
b62b75905d571c NeilBrown 2008-10-21 5725 }
d3374825ce57ba NeilBrown 2009-01-09 5726 mddev_put(mddev);
0909dc448c98ed NeilBrown 2009-07-01 5727 return error;
efeb53c0e57213 NeilBrown 2009-01-09 5728 }
efeb53c0e57213 NeilBrown 2009-01-09 5729
:::::: The code at line 5705 was first introduced by commit
:::::: b0140891a8cea36469f58d23859e599b1122bd37 md: Fix race when creating a new md device.
:::::: TO: NeilBrown <neilb(a)suse.de>
:::::: CC: NeilBrown <neilb(a)suse.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
11 months
Re: [RFC 2/3] mm/vmalloc: add support for __GFP_NOFAIL
by kernel test robot
Hi Michal,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on ceph-client/for-linus]
[also build test ERROR on v5.15-rc6]
[cannot apply to hnaz-mm/master next-20211018]
[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/Michal-Hocko/extend-vmalloc-supp...
base: https://github.com/ceph/ceph-client.git for-linus
config: hexagon-buildonly-randconfig-r005-20211018 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d245f2e8597bfb52c34810a328d42b990e4af1a4)
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/0day-ci/linux/commit/ff0475c921959da4fd8e7d29e5a06739a...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Michal-Hocko/extend-vmalloc-support-for-constrained-allocations/20211018-194834
git checkout ff0475c921959da4fd8e7d29e5a06739a1c52386
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=hexagon
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/vmalloc.c:3037:16: error: use of logical '&&' with constant operand [-Werror,-Wconstant-logical-operand]
if (gfp_mask && __GFP_NOFAIL)
^ ~~~~~~~~~~~~
mm/vmalloc.c:3037:16: note: use '&' for a bitwise operation
if (gfp_mask && __GFP_NOFAIL)
^~
&
mm/vmalloc.c:3037:16: note: remove constant to silence this warning
if (gfp_mask && __GFP_NOFAIL)
~^~~~~~~~~~~~~~~
1 error generated.
vim +3037 mm/vmalloc.c
2967
2968 /**
2969 * __vmalloc_node_range - allocate virtually contiguous memory
2970 * @size: allocation size
2971 * @align: desired alignment
2972 * @start: vm area range start
2973 * @end: vm area range end
2974 * @gfp_mask: flags for the page level allocator
2975 * @prot: protection mask for the allocated pages
2976 * @vm_flags: additional vm area flags (e.g. %VM_NO_GUARD)
2977 * @node: node to use for allocation or NUMA_NO_NODE
2978 * @caller: caller's return address
2979 *
2980 * Allocate enough pages to cover @size from the page level
2981 * allocator with @gfp_mask flags. Map them into contiguous
2982 * kernel virtual space, using a pagetable protection of @prot.
2983 *
2984 * Return: the address of the area or %NULL on failure
2985 */
2986 void *__vmalloc_node_range(unsigned long size, unsigned long align,
2987 unsigned long start, unsigned long end, gfp_t gfp_mask,
2988 pgprot_t prot, unsigned long vm_flags, int node,
2989 const void *caller)
2990 {
2991 struct vm_struct *area;
2992 void *addr;
2993 unsigned long real_size = size;
2994 unsigned long real_align = align;
2995 unsigned int shift = PAGE_SHIFT;
2996
2997 if (WARN_ON_ONCE(!size))
2998 return NULL;
2999
3000 if ((size >> PAGE_SHIFT) > totalram_pages()) {
3001 warn_alloc(gfp_mask, NULL,
3002 "vmalloc error: size %lu, exceeds total pages",
3003 real_size);
3004 return NULL;
3005 }
3006
3007 if (vmap_allow_huge && !(vm_flags & VM_NO_HUGE_VMAP)) {
3008 unsigned long size_per_node;
3009
3010 /*
3011 * Try huge pages. Only try for PAGE_KERNEL allocations,
3012 * others like modules don't yet expect huge pages in
3013 * their allocations due to apply_to_page_range not
3014 * supporting them.
3015 */
3016
3017 size_per_node = size;
3018 if (node == NUMA_NO_NODE)
3019 size_per_node /= num_online_nodes();
3020 if (arch_vmap_pmd_supported(prot) && size_per_node >= PMD_SIZE)
3021 shift = PMD_SHIFT;
3022 else
3023 shift = arch_vmap_pte_supported_shift(size_per_node);
3024
3025 align = max(real_align, 1UL << shift);
3026 size = ALIGN(real_size, 1UL << shift);
3027 }
3028
3029 again:
3030 area = __get_vm_area_node(real_size, align, shift, VM_ALLOC |
3031 VM_UNINITIALIZED | vm_flags, start, end, node,
3032 gfp_mask, caller);
3033 if (!area) {
3034 warn_alloc(gfp_mask, NULL,
3035 "vmalloc error: size %lu, vm_struct allocation failed",
3036 real_size);
> 3037 if (gfp_mask && __GFP_NOFAIL)
3038 goto again;
3039 goto fail;
3040 }
3041
3042 addr = __vmalloc_area_node(area, gfp_mask, prot, shift, node);
3043 if (!addr)
3044 goto fail;
3045
3046 /*
3047 * In this function, newly allocated vm_struct has VM_UNINITIALIZED
3048 * flag. It means that vm_struct is not fully initialized.
3049 * Now, it is fully initialized, so remove this flag here.
3050 */
3051 clear_vm_uninitialized_flag(area);
3052
3053 size = PAGE_ALIGN(size);
3054 kmemleak_vmalloc(area, size, gfp_mask);
3055
3056 return addr;
3057
3058 fail:
3059 if (shift > PAGE_SHIFT) {
3060 shift = PAGE_SHIFT;
3061 align = real_align;
3062 size = real_size;
3063 goto again;
3064 }
3065
3066 return NULL;
3067 }
3068
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
11 months
Re: [RFC 2/3] mm/vmalloc: add support for __GFP_NOFAIL
by kernel test robot
Hi Michal,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on ceph-client/for-linus]
[also build test WARNING on v5.15-rc6]
[cannot apply to hnaz-mm/master next-20211018]
[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/Michal-Hocko/extend-vmalloc-supp...
base: https://github.com/ceph/ceph-client.git for-linus
config: hexagon-randconfig-r041-20211018 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d245f2e8597bfb52c34810a328d42b990e4af1a4)
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/0day-ci/linux/commit/ff0475c921959da4fd8e7d29e5a06739a...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Michal-Hocko/extend-vmalloc-support-for-constrained-allocations/20211018-194834
git checkout ff0475c921959da4fd8e7d29e5a06739a1c52386
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=hexagon
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/vmalloc.c:3037:16: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]
if (gfp_mask && __GFP_NOFAIL)
^ ~~~~~~~~~~~~
mm/vmalloc.c:3037:16: note: use '&' for a bitwise operation
if (gfp_mask && __GFP_NOFAIL)
^~
&
mm/vmalloc.c:3037:16: note: remove constant to silence this warning
if (gfp_mask && __GFP_NOFAIL)
~^~~~~~~~~~~~~~~
mm/vmalloc.c:781:1: warning: unused function 'compute_subtree_max_size' [-Wunused-function]
compute_subtree_max_size(struct vmap_area *va)
^
2 warnings generated.
vim +3037 mm/vmalloc.c
2967
2968 /**
2969 * __vmalloc_node_range - allocate virtually contiguous memory
2970 * @size: allocation size
2971 * @align: desired alignment
2972 * @start: vm area range start
2973 * @end: vm area range end
2974 * @gfp_mask: flags for the page level allocator
2975 * @prot: protection mask for the allocated pages
2976 * @vm_flags: additional vm area flags (e.g. %VM_NO_GUARD)
2977 * @node: node to use for allocation or NUMA_NO_NODE
2978 * @caller: caller's return address
2979 *
2980 * Allocate enough pages to cover @size from the page level
2981 * allocator with @gfp_mask flags. Map them into contiguous
2982 * kernel virtual space, using a pagetable protection of @prot.
2983 *
2984 * Return: the address of the area or %NULL on failure
2985 */
2986 void *__vmalloc_node_range(unsigned long size, unsigned long align,
2987 unsigned long start, unsigned long end, gfp_t gfp_mask,
2988 pgprot_t prot, unsigned long vm_flags, int node,
2989 const void *caller)
2990 {
2991 struct vm_struct *area;
2992 void *addr;
2993 unsigned long real_size = size;
2994 unsigned long real_align = align;
2995 unsigned int shift = PAGE_SHIFT;
2996
2997 if (WARN_ON_ONCE(!size))
2998 return NULL;
2999
3000 if ((size >> PAGE_SHIFT) > totalram_pages()) {
3001 warn_alloc(gfp_mask, NULL,
3002 "vmalloc error: size %lu, exceeds total pages",
3003 real_size);
3004 return NULL;
3005 }
3006
3007 if (vmap_allow_huge && !(vm_flags & VM_NO_HUGE_VMAP)) {
3008 unsigned long size_per_node;
3009
3010 /*
3011 * Try huge pages. Only try for PAGE_KERNEL allocations,
3012 * others like modules don't yet expect huge pages in
3013 * their allocations due to apply_to_page_range not
3014 * supporting them.
3015 */
3016
3017 size_per_node = size;
3018 if (node == NUMA_NO_NODE)
3019 size_per_node /= num_online_nodes();
3020 if (arch_vmap_pmd_supported(prot) && size_per_node >= PMD_SIZE)
3021 shift = PMD_SHIFT;
3022 else
3023 shift = arch_vmap_pte_supported_shift(size_per_node);
3024
3025 align = max(real_align, 1UL << shift);
3026 size = ALIGN(real_size, 1UL << shift);
3027 }
3028
3029 again:
3030 area = __get_vm_area_node(real_size, align, shift, VM_ALLOC |
3031 VM_UNINITIALIZED | vm_flags, start, end, node,
3032 gfp_mask, caller);
3033 if (!area) {
3034 warn_alloc(gfp_mask, NULL,
3035 "vmalloc error: size %lu, vm_struct allocation failed",
3036 real_size);
> 3037 if (gfp_mask && __GFP_NOFAIL)
3038 goto again;
3039 goto fail;
3040 }
3041
3042 addr = __vmalloc_area_node(area, gfp_mask, prot, shift, node);
3043 if (!addr)
3044 goto fail;
3045
3046 /*
3047 * In this function, newly allocated vm_struct has VM_UNINITIALIZED
3048 * flag. It means that vm_struct is not fully initialized.
3049 * Now, it is fully initialized, so remove this flag here.
3050 */
3051 clear_vm_uninitialized_flag(area);
3052
3053 size = PAGE_ALIGN(size);
3054 kmemleak_vmalloc(area, size, gfp_mask);
3055
3056 return addr;
3057
3058 fail:
3059 if (shift > PAGE_SHIFT) {
3060 shift = PAGE_SHIFT;
3061 align = real_align;
3062 size = real_size;
3063 goto again;
3064 }
3065
3066 return NULL;
3067 }
3068
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
11 months, 1 week
[rt-devel:linux-5.15.y-rt-rebase 88/154] mm/vmalloc.c:1884:17: error: variable 'cpu' set but not used
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-5.15.y-rt-rebase
head: a3db22d52bcddd44890e6aa1439c2dd2a61a5847
commit: 07df2fdc42f1aebf3ae015e135556146d5bd4106 [88/154] mm/vmalloc: Another preempt disable region which sucks
config: riscv-buildonly-randconfig-r005-20211018 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d245f2e8597bfb52c34810a328d42b990e4af1a4)
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 riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git/com...
git remote add rt-devel https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git
git fetch --no-tags rt-devel linux-5.15.y-rt-rebase
git checkout 07df2fdc42f1aebf3ae015e135556146d5bd4106
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=riscv
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/vmalloc.c:1884:17: error: variable 'cpu' set but not used [-Werror,-Wunused-but-set-variable]
int node, err, cpu;
^
mm/vmalloc.c:1991:6: error: variable 'cpu' set but not used [-Werror,-Wunused-but-set-variable]
int cpu;
^
2 errors generated.
vim +/cpu +1884 mm/vmalloc.c
1869
1870 /**
1871 * new_vmap_block - allocates new vmap_block and occupies 2^order pages in this
1872 * block. Of course pages number can't exceed VMAP_BBMAP_BITS
1873 * @order: how many 2^order pages should be occupied in newly allocated block
1874 * @gfp_mask: flags for the page level allocator
1875 *
1876 * Return: virtual address in a newly allocated block or ERR_PTR(-errno)
1877 */
1878 static void *new_vmap_block(unsigned int order, gfp_t gfp_mask)
1879 {
1880 struct vmap_block_queue *vbq;
1881 struct vmap_block *vb;
1882 struct vmap_area *va;
1883 unsigned long vb_idx;
> 1884 int node, err, cpu;
1885 void *vaddr;
1886
1887 node = numa_node_id();
1888
1889 vb = kmalloc_node(sizeof(struct vmap_block),
1890 gfp_mask & GFP_RECLAIM_MASK, node);
1891 if (unlikely(!vb))
1892 return ERR_PTR(-ENOMEM);
1893
1894 va = alloc_vmap_area(VMAP_BLOCK_SIZE, VMAP_BLOCK_SIZE,
1895 VMALLOC_START, VMALLOC_END,
1896 node, gfp_mask);
1897 if (IS_ERR(va)) {
1898 kfree(vb);
1899 return ERR_CAST(va);
1900 }
1901
1902 vaddr = vmap_block_vaddr(va->va_start, 0);
1903 spin_lock_init(&vb->lock);
1904 vb->va = va;
1905 /* At least something should be left free */
1906 BUG_ON(VMAP_BBMAP_BITS <= (1UL << order));
1907 vb->free = VMAP_BBMAP_BITS - (1UL << order);
1908 vb->dirty = 0;
1909 vb->dirty_min = VMAP_BBMAP_BITS;
1910 vb->dirty_max = 0;
1911 INIT_LIST_HEAD(&vb->free_list);
1912
1913 vb_idx = addr_to_vb_idx(va->va_start);
1914 err = xa_insert(&vmap_blocks, vb_idx, vb, gfp_mask);
1915 if (err) {
1916 kfree(vb);
1917 free_vmap_area(va);
1918 return ERR_PTR(err);
1919 }
1920
1921 cpu = get_cpu_light();
1922 vbq = this_cpu_ptr(&vmap_block_queue);
1923 spin_lock(&vbq->lock);
1924 list_add_tail_rcu(&vb->free_list, &vbq->free);
1925 spin_unlock(&vbq->lock);
1926 put_cpu_light();
1927
1928 return vaddr;
1929 }
1930
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
11 months, 1 week
Re: [PATCH] usb: max-3421: Use driver data instead of maintaining a list of bound devices
by kernel test robot
Hi "Uwe,
I love your patch! Perhaps something to improve:
[auto build test WARNING on usb/usb-testing]
[also build test WARNING on v5.15-rc6 next-20211018]
[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/Uwe-Kleine-K-nig/usb-max-3421-Us...
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
config: i386-randconfig-r025-20211018 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d245f2e8597bfb52c34810a328d42b990e4af1a4)
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/0day-ci/linux/commit/9ee7ff2f570093a02d9ae5e402a5becfd...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Uwe-Kleine-K-nig/usb-max-3421-Use-driver-data-instead-of-maintaining-a-list-of-bound-devices/20211018-200133
git checkout 9ee7ff2f570093a02d9ae5e402a5becfdf87b9f5
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 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/usb/host/max3421-hcd.c:1880:18: warning: variable 'max3421_hcd' is uninitialized when used here [-Wuninitialized]
INIT_LIST_HEAD(&max3421_hcd->ep_list);
^~~~~~~~~~~
drivers/usb/host/max3421-hcd.c:1827:33: note: initialize the variable 'max3421_hcd' to silence this warning
struct max3421_hcd *max3421_hcd;
^
= NULL
1 warning generated.
vim +/max3421_hcd +1880 drivers/usb/host/max3421-hcd.c
721fdc83b31b1b Jules Maselbas 2017-09-15 1822
2d53139f31626b David Mosberger 2014-04-28 1823 static int
2d53139f31626b David Mosberger 2014-04-28 1824 max3421_probe(struct spi_device *spi)
2d53139f31626b David Mosberger 2014-04-28 1825 {
721fdc83b31b1b Jules Maselbas 2017-09-15 1826 struct device *dev = &spi->dev;
2d53139f31626b David Mosberger 2014-04-28 1827 struct max3421_hcd *max3421_hcd;
05dfa5c9bc3793 David Mosberger-Tang 2014-05-28 1828 struct usb_hcd *hcd = NULL;
721fdc83b31b1b Jules Maselbas 2017-09-15 1829 struct max3421_hcd_platform_data *pdata = NULL;
5a569343e8a618 Yang Yingliang 2020-11-17 1830 int retval;
2d53139f31626b David Mosberger 2014-04-28 1831
2d53139f31626b David Mosberger 2014-04-28 1832 if (spi_setup(spi) < 0) {
2d53139f31626b David Mosberger 2014-04-28 1833 dev_err(&spi->dev, "Unable to setup SPI bus");
2d53139f31626b David Mosberger 2014-04-28 1834 return -EFAULT;
2d53139f31626b David Mosberger 2014-04-28 1835 }
2d53139f31626b David Mosberger 2014-04-28 1836
721fdc83b31b1b Jules Maselbas 2017-09-15 1837 if (!spi->irq) {
721fdc83b31b1b Jules Maselbas 2017-09-15 1838 dev_err(dev, "Failed to get SPI IRQ");
721fdc83b31b1b Jules Maselbas 2017-09-15 1839 return -EFAULT;
721fdc83b31b1b Jules Maselbas 2017-09-15 1840 }
721fdc83b31b1b Jules Maselbas 2017-09-15 1841
721fdc83b31b1b Jules Maselbas 2017-09-15 1842 if (IS_ENABLED(CONFIG_OF) && dev->of_node) {
721fdc83b31b1b Jules Maselbas 2017-09-15 1843 pdata = devm_kzalloc(&spi->dev, sizeof(*pdata), GFP_KERNEL);
721fdc83b31b1b Jules Maselbas 2017-09-15 1844 if (!pdata) {
721fdc83b31b1b Jules Maselbas 2017-09-15 1845 retval = -ENOMEM;
721fdc83b31b1b Jules Maselbas 2017-09-15 1846 goto error;
721fdc83b31b1b Jules Maselbas 2017-09-15 1847 }
721fdc83b31b1b Jules Maselbas 2017-09-15 1848 retval = max3421_of_vbus_en_pin(dev, pdata);
721fdc83b31b1b Jules Maselbas 2017-09-15 1849 if (retval)
721fdc83b31b1b Jules Maselbas 2017-09-15 1850 goto error;
721fdc83b31b1b Jules Maselbas 2017-09-15 1851
721fdc83b31b1b Jules Maselbas 2017-09-15 1852 spi->dev.platform_data = pdata;
721fdc83b31b1b Jules Maselbas 2017-09-15 1853 }
721fdc83b31b1b Jules Maselbas 2017-09-15 1854
721fdc83b31b1b Jules Maselbas 2017-09-15 1855 pdata = spi->dev.platform_data;
721fdc83b31b1b Jules Maselbas 2017-09-15 1856 if (!pdata) {
721fdc83b31b1b Jules Maselbas 2017-09-15 1857 dev_err(&spi->dev, "driver configuration data is not provided\n");
721fdc83b31b1b Jules Maselbas 2017-09-15 1858 retval = -EFAULT;
721fdc83b31b1b Jules Maselbas 2017-09-15 1859 goto error;
721fdc83b31b1b Jules Maselbas 2017-09-15 1860 }
721fdc83b31b1b Jules Maselbas 2017-09-15 1861 if (pdata->vbus_active_level > 1) {
721fdc83b31b1b Jules Maselbas 2017-09-15 1862 dev_err(&spi->dev, "vbus active level value %d is out of range (0/1)\n", pdata->vbus_active_level);
721fdc83b31b1b Jules Maselbas 2017-09-15 1863 retval = -EINVAL;
721fdc83b31b1b Jules Maselbas 2017-09-15 1864 goto error;
721fdc83b31b1b Jules Maselbas 2017-09-15 1865 }
721fdc83b31b1b Jules Maselbas 2017-09-15 1866 if (pdata->vbus_gpout < 1 || pdata->vbus_gpout > MAX3421_GPOUT_COUNT) {
721fdc83b31b1b Jules Maselbas 2017-09-15 1867 dev_err(&spi->dev, "vbus gpout value %d is out of range (1..8)\n", pdata->vbus_gpout);
721fdc83b31b1b Jules Maselbas 2017-09-15 1868 retval = -EINVAL;
721fdc83b31b1b Jules Maselbas 2017-09-15 1869 goto error;
721fdc83b31b1b Jules Maselbas 2017-09-15 1870 }
721fdc83b31b1b Jules Maselbas 2017-09-15 1871
5a569343e8a618 Yang Yingliang 2020-11-17 1872 retval = -ENOMEM;
2d53139f31626b David Mosberger 2014-04-28 1873 hcd = usb_create_hcd(&max3421_hcd_desc, &spi->dev,
2d53139f31626b David Mosberger 2014-04-28 1874 dev_name(&spi->dev));
2d53139f31626b David Mosberger 2014-04-28 1875 if (!hcd) {
2d53139f31626b David Mosberger 2014-04-28 1876 dev_err(&spi->dev, "failed to create HCD structure\n");
05dfa5c9bc3793 David Mosberger-Tang 2014-05-28 1877 goto error;
2d53139f31626b David Mosberger 2014-04-28 1878 }
2d53139f31626b David Mosberger 2014-04-28 1879 set_bit(HCD_FLAG_POLL_RH, &hcd->flags);
2d53139f31626b David Mosberger 2014-04-28 @1880 INIT_LIST_HEAD(&max3421_hcd->ep_list);
9ee7ff2f570093 Uwe Kleine-König 2021-10-18 1881 spi_set_drvdata(spi, max3421_hcd);
2d53139f31626b David Mosberger 2014-04-28 1882
05dfa5c9bc3793 David Mosberger-Tang 2014-05-28 1883 max3421_hcd->tx = kmalloc(sizeof(*max3421_hcd->tx), GFP_KERNEL);
13dcf780059417 Wolfram Sang 2016-08-25 1884 if (!max3421_hcd->tx)
05dfa5c9bc3793 David Mosberger-Tang 2014-05-28 1885 goto error;
05dfa5c9bc3793 David Mosberger-Tang 2014-05-28 1886 max3421_hcd->rx = kmalloc(sizeof(*max3421_hcd->rx), GFP_KERNEL);
13dcf780059417 Wolfram Sang 2016-08-25 1887 if (!max3421_hcd->rx)
05dfa5c9bc3793 David Mosberger-Tang 2014-05-28 1888 goto error;
05dfa5c9bc3793 David Mosberger-Tang 2014-05-28 1889
2d53139f31626b David Mosberger 2014-04-28 1890 max3421_hcd->spi_thread = kthread_run(max3421_spi_thread, hcd,
2d53139f31626b David Mosberger 2014-04-28 1891 "max3421_spi_thread");
2d53139f31626b David Mosberger 2014-04-28 1892 if (max3421_hcd->spi_thread == ERR_PTR(-ENOMEM)) {
2d53139f31626b David Mosberger 2014-04-28 1893 dev_err(&spi->dev,
2d53139f31626b David Mosberger 2014-04-28 1894 "failed to create SPI thread (out of memory)\n");
05dfa5c9bc3793 David Mosberger-Tang 2014-05-28 1895 goto error;
2d53139f31626b David Mosberger 2014-04-28 1896 }
2d53139f31626b David Mosberger 2014-04-28 1897
2d53139f31626b David Mosberger 2014-04-28 1898 retval = usb_add_hcd(hcd, 0, 0);
2d53139f31626b David Mosberger 2014-04-28 1899 if (retval) {
2d53139f31626b David Mosberger 2014-04-28 1900 dev_err(&spi->dev, "failed to add HCD\n");
05dfa5c9bc3793 David Mosberger-Tang 2014-05-28 1901 goto error;
2d53139f31626b David Mosberger 2014-04-28 1902 }
2d53139f31626b David Mosberger 2014-04-28 1903
2d53139f31626b David Mosberger 2014-04-28 1904 retval = request_irq(spi->irq, max3421_irq_handler,
2d53139f31626b David Mosberger 2014-04-28 1905 IRQF_TRIGGER_LOW, "max3421", hcd);
2d53139f31626b David Mosberger 2014-04-28 1906 if (retval < 0) {
2d53139f31626b David Mosberger 2014-04-28 1907 dev_err(&spi->dev, "failed to request irq %d\n", spi->irq);
05dfa5c9bc3793 David Mosberger-Tang 2014-05-28 1908 goto error;
2d53139f31626b David Mosberger 2014-04-28 1909 }
2d53139f31626b David Mosberger 2014-04-28 1910 return 0;
05dfa5c9bc3793 David Mosberger-Tang 2014-05-28 1911
05dfa5c9bc3793 David Mosberger-Tang 2014-05-28 1912 error:
721fdc83b31b1b Jules Maselbas 2017-09-15 1913 if (IS_ENABLED(CONFIG_OF) && dev->of_node && pdata) {
721fdc83b31b1b Jules Maselbas 2017-09-15 1914 devm_kfree(&spi->dev, pdata);
721fdc83b31b1b Jules Maselbas 2017-09-15 1915 spi->dev.platform_data = NULL;
721fdc83b31b1b Jules Maselbas 2017-09-15 1916 }
721fdc83b31b1b Jules Maselbas 2017-09-15 1917
05dfa5c9bc3793 David Mosberger-Tang 2014-05-28 1918 if (hcd) {
05dfa5c9bc3793 David Mosberger-Tang 2014-05-28 1919 kfree(max3421_hcd->tx);
05dfa5c9bc3793 David Mosberger-Tang 2014-05-28 1920 kfree(max3421_hcd->rx);
05dfa5c9bc3793 David Mosberger-Tang 2014-05-28 1921 if (max3421_hcd->spi_thread)
05dfa5c9bc3793 David Mosberger-Tang 2014-05-28 1922 kthread_stop(max3421_hcd->spi_thread);
05dfa5c9bc3793 David Mosberger-Tang 2014-05-28 1923 usb_put_hcd(hcd);
05dfa5c9bc3793 David Mosberger-Tang 2014-05-28 1924 }
05dfa5c9bc3793 David Mosberger-Tang 2014-05-28 1925 return retval;
2d53139f31626b David Mosberger 2014-04-28 1926 }
2d53139f31626b David Mosberger 2014-04-28 1927
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
11 months, 1 week
[linux-next:master 7104/8410] drivers/power/supply/axp288_charger.c:411:8: error: implicit declaration of function 'iosf_mbi_block_punit_i2c_access'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 7c832d2f9b959e3181370c8b0dacaf9efe13fc05
commit: ed229454856e565c5a7d3287cbc63f2cf077b34f [7104/8410] power: supply: axp288-charger: Optimize register reading method
config: i386-randconfig-c001-20211016 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 8ca4b3ef19fe82d7ad6a6e1515317dcc01b41515)
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/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout ed229454856e565c5a7d3287cbc63f2cf077b34f
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Note: the linux-next/master HEAD 7c832d2f9b959e3181370c8b0dacaf9efe13fc05 builds fine.
It may have been fixed somewhere.
All errors (new ones prefixed by >>):
>> drivers/power/supply/axp288_charger.c:411:8: error: implicit declaration of function 'iosf_mbi_block_punit_i2c_access' [-Werror,-Wimplicit-function-declaration]
ret = iosf_mbi_block_punit_i2c_access();
^
>> drivers/power/supply/axp288_charger.c:430:2: error: implicit declaration of function 'iosf_mbi_unblock_punit_i2c_access' [-Werror,-Wimplicit-function-declaration]
iosf_mbi_unblock_punit_i2c_access();
^
drivers/power/supply/axp288_charger.c:430:2: note: did you mean 'iosf_mbi_block_punit_i2c_access'?
drivers/power/supply/axp288_charger.c:411:8: note: 'iosf_mbi_block_punit_i2c_access' declared here
ret = iosf_mbi_block_punit_i2c_access();
^
2 errors generated.
vim +/iosf_mbi_block_punit_i2c_access +411 drivers/power/supply/axp288_charger.c
401
402 static int axp288_charger_usb_update_property(struct axp288_chrg_info *info)
403 {
404 int ret = 0;
405
406 if (info->valid && time_before(jiffies, info->last_updated + AXP288_REG_UPDATE_INTERVAL))
407 return 0;
408
409 dev_dbg(&info->pdev->dev, "Charger updating register values...\n");
410
> 411 ret = iosf_mbi_block_punit_i2c_access();
412 if (ret < 0)
413 return ret;
414
415 ret = axp288_charger_reg_readb(info, AXP20X_PWR_INPUT_STATUS, &info->input_status);
416 if (ret < 0)
417 goto out;
418
419 ret = axp288_charger_reg_readb(info, AXP20X_PWR_OP_MODE, &info->op_mode);
420 if (ret < 0)
421 goto out;
422
423 ret = axp288_charger_reg_readb(info, AXP20X_CHRG_BAK_CTRL, &info->backend_control);
424 if (ret < 0)
425 goto out;
426
427 info->last_updated = jiffies;
428 info->valid = true;
429 out:
> 430 iosf_mbi_unblock_punit_i2c_access();
431 return ret;
432 }
433
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
11 months, 1 week
Re: [PATCH] PCI: Remove the unused pci wrappers pci_pool_xxx()
by kernel test robot
Hi Cai,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on helgaas-pci/next]
[also build test ERROR on v5.15-rc6 next-20211018]
[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/Cai-Huoqing/PCI-Remove-the-unuse...
base: https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next
config: i386-randconfig-a015-20211018 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d245f2e8597bfb52c34810a328d42b990e4af1a4)
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/0day-ci/linux/commit/35cdbe7c76652cc75a170ef91c4dafac9...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Cai-Huoqing/PCI-Remove-the-unused-pci-wrappers-pci_pool_xxx/20211018-161828
git checkout 35cdbe7c76652cc75a170ef91c4dafac9773e8c0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
>> drivers/scsi/lpfc/lpfc_mem.c:92:25: error: implicit declaration of function 'dma_pool_create' [-Werror,-Wimplicit-function-declaration]
phba->lpfc_mbuf_pool = dma_pool_create("lpfc_mbuf_pool", &phba->pcidev->dev,
^
drivers/scsi/lpfc/lpfc_mem.c:92:25: note: did you mean 'mempool_create'?
include/linux/mempool.h:40:19: note: 'mempool_create' declared here
extern mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn,
^
>> drivers/scsi/lpfc/lpfc_mem.c:92:23: warning: incompatible integer to pointer conversion assigning to 'struct dma_pool *' from 'int' [-Wint-conversion]
phba->lpfc_mbuf_pool = dma_pool_create("lpfc_mbuf_pool", &phba->pcidev->dev,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/lpfc/lpfc_mem.c:107:28: error: implicit declaration of function 'dma_pool_alloc' [-Werror,-Wimplicit-function-declaration]
pool->elements[i].virt = dma_pool_alloc(phba->lpfc_mbuf_pool,
^
drivers/scsi/lpfc/lpfc_mem.c:107:28: note: did you mean 'mempool_alloc'?
include/linux/mempool.h:48:14: note: 'mempool_alloc' declared here
extern void *mempool_alloc(mempool_t *pool, gfp_t gfp_mask) __malloc;
^
>> drivers/scsi/lpfc/lpfc_mem.c:107:26: warning: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
pool->elements[i].virt = dma_pool_alloc(phba->lpfc_mbuf_pool,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/lpfc/lpfc_mem.c:131:23: warning: incompatible integer to pointer conversion assigning to 'struct dma_pool *' from 'int' [-Wint-conversion]
phba->lpfc_hrb_pool = dma_pool_create("lpfc_hrb_pool",
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/lpfc/lpfc_mem.c:137:23: warning: incompatible integer to pointer conversion assigning to 'struct dma_pool *' from 'int' [-Wint-conversion]
phba->lpfc_drb_pool = dma_pool_create("lpfc_drb_pool",
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/lpfc/lpfc_mem.c:144:23: warning: incompatible integer to pointer conversion assigning to 'struct dma_pool *' from 'int' [-Wint-conversion]
phba->lpfc_hbq_pool = dma_pool_create("lpfc_hbq_pool",
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/lpfc/lpfc_mem.c:164:2: error: implicit declaration of function 'dma_pool_destroy' [-Werror,-Wimplicit-function-declaration]
dma_pool_destroy(phba->lpfc_drb_pool);
^
drivers/scsi/lpfc/lpfc_mem.c:164:2: note: did you mean 'mempool_destroy'?
include/linux/mempool.h:47:13: note: 'mempool_destroy' declared here
extern void mempool_destroy(mempool_t *pool);
^
>> drivers/scsi/lpfc/lpfc_mem.c:180:3: error: implicit declaration of function 'dma_pool_free' [-Werror,-Wimplicit-function-declaration]
dma_pool_free(phba->lpfc_mbuf_pool, pool->elements[i].virt,
^
drivers/scsi/lpfc/lpfc_mem.c:194:3: error: implicit declaration of function 'dma_pool_create' [-Werror,-Wimplicit-function-declaration]
dma_pool_create("lpfc_nvmet_drb_pool",
^
drivers/scsi/lpfc/lpfc_mem.c:193:28: warning: incompatible integer to pointer conversion assigning to 'struct dma_pool *' from 'int' [-Wint-conversion]
phba->lpfc_nvmet_drb_pool =
^
drivers/scsi/lpfc/lpfc_mem.c:223:2: error: implicit declaration of function 'dma_pool_destroy' [-Werror,-Wimplicit-function-declaration]
dma_pool_destroy(phba->lpfc_nvmet_drb_pool);
^
drivers/scsi/lpfc/lpfc_mem.c:252:3: error: implicit declaration of function 'dma_pool_free' [-Werror,-Wimplicit-function-declaration]
dma_pool_free(phba->lpfc_mbuf_pool, pool->elements[i].virt,
^
drivers/scsi/lpfc/lpfc_mem.c:332:2: error: implicit declaration of function 'dma_pool_destroy' [-Werror,-Wimplicit-function-declaration]
dma_pool_destroy(phba->lpfc_sg_dma_buf_pool);
^
drivers/scsi/lpfc/lpfc_mem.c:383:8: error: implicit declaration of function 'dma_pool_alloc' [-Werror,-Wimplicit-function-declaration]
ret = dma_pool_alloc(phba->lpfc_mbuf_pool, GFP_KERNEL, handle);
^
drivers/scsi/lpfc/lpfc_mem.c:383:6: warning: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
ret = dma_pool_alloc(phba->lpfc_mbuf_pool, GFP_KERNEL, handle);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/lpfc/lpfc_mem.c:419:3: error: implicit declaration of function 'dma_pool_free' [-Werror,-Wimplicit-function-declaration]
dma_pool_free(phba->lpfc_mbuf_pool, virt, dma);
^
drivers/scsi/lpfc/lpfc_mem.c:467:8: error: implicit declaration of function 'dma_pool_alloc' [-Werror,-Wimplicit-function-declaration]
ret = dma_pool_alloc(phba->lpfc_sg_dma_buf_pool, GFP_KERNEL, handle);
^
drivers/scsi/lpfc/lpfc_mem.c:467:6: warning: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
ret = dma_pool_alloc(phba->lpfc_sg_dma_buf_pool, GFP_KERNEL, handle);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/lpfc/lpfc_mem.c:483:2: error: implicit declaration of function 'dma_pool_free' [-Werror,-Wimplicit-function-declaration]
dma_pool_free(phba->lpfc_sg_dma_buf_pool, virt, dma);
^
drivers/scsi/lpfc/lpfc_mem.c:508:21: error: implicit declaration of function 'dma_pool_alloc' [-Werror,-Wimplicit-function-declaration]
hbqbp->dbuf.virt = dma_pool_alloc(phba->lpfc_hbq_pool, GFP_KERNEL,
^
drivers/scsi/lpfc/lpfc_mem.c:508:19: warning: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
hbqbp->dbuf.virt = dma_pool_alloc(phba->lpfc_hbq_pool, GFP_KERNEL,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/lpfc/lpfc_mem.c:533:2: error: implicit declaration of function 'dma_pool_free' [-Werror,-Wimplicit-function-declaration]
dma_pool_free(phba->lpfc_hbq_pool, hbqbp->dbuf.virt, hbqbp->dbuf.phys);
^
drivers/scsi/lpfc/lpfc_mem.c:560:23: error: implicit declaration of function 'dma_pool_alloc' [-Werror,-Wimplicit-function-declaration]
dma_buf->hbuf.virt = dma_pool_alloc(phba->lpfc_hrb_pool, GFP_KERNEL,
^
drivers/scsi/lpfc/lpfc_mem.c:560:21: warning: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
dma_buf->hbuf.virt = dma_pool_alloc(phba->lpfc_hrb_pool, GFP_KERNEL,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/lpfc/lpfc_mem.c:566:21: warning: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
dma_buf->dbuf.virt = dma_pool_alloc(phba->lpfc_drb_pool, GFP_KERNEL,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/lpfc/lpfc_mem.c:569:3: error: implicit declaration of function 'dma_pool_free' [-Werror,-Wimplicit-function-declaration]
dma_pool_free(phba->lpfc_hrb_pool, dma_buf->hbuf.virt,
^
drivers/scsi/lpfc/lpfc_mem.c:593:2: error: implicit declaration of function 'dma_pool_free' [-Werror,-Wimplicit-function-declaration]
dma_pool_free(phba->lpfc_hrb_pool, dmab->hbuf.virt, dmab->hbuf.phys);
^
drivers/scsi/lpfc/lpfc_mem.c:618:23: error: implicit declaration of function 'dma_pool_alloc' [-Werror,-Wimplicit-function-declaration]
dma_buf->hbuf.virt = dma_pool_alloc(phba->lpfc_hrb_pool, GFP_KERNEL,
^
drivers/scsi/lpfc/lpfc_mem.c:618:21: warning: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
dma_buf->hbuf.virt = dma_pool_alloc(phba->lpfc_hrb_pool, GFP_KERNEL,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/lpfc/lpfc_mem.c:624:21: warning: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
dma_buf->dbuf.virt = dma_pool_alloc(phba->lpfc_nvmet_drb_pool,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/lpfc/lpfc_mem.c:627:3: error: implicit declaration of function 'dma_pool_free' [-Werror,-Wimplicit-function-declaration]
dma_pool_free(phba->lpfc_hrb_pool, dma_buf->hbuf.virt,
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
13 warnings and 20 errors generated.
--
drivers/scsi/lpfc/lpfc_sli.c:15629:6: warning: variable 'i' set but not used [-Wunused-but-set-variable]
int i = 0;
^
>> drivers/scsi/lpfc/lpfc_sli.c:19245:3: error: implicit declaration of function 'dma_pool_free' [-Werror,-Wimplicit-function-declaration]
dma_pool_free(phba->lpfc_drb_pool, pcmd->virt, pcmd->phys);
^
drivers/scsi/lpfc/lpfc_sli.c:19245:3: note: did you mean 'mempool_free'?
include/linux/mempool.h:49:13: note: 'mempool_free' declared here
extern void mempool_free(void *element, mempool_t *pool);
^
>> drivers/scsi/lpfc/lpfc_sli.c:19283:16: error: implicit declaration of function 'dma_pool_alloc' [-Werror,-Wimplicit-function-declaration]
pcmd->virt = dma_pool_alloc(phba->lpfc_drb_pool, GFP_KERNEL,
^
drivers/scsi/lpfc/lpfc_sli.c:19283:16: note: did you mean 'mempool_alloc'?
include/linux/mempool.h:48:14: note: 'mempool_alloc' declared here
extern void *mempool_alloc(mempool_t *pool, gfp_t gfp_mask) __malloc;
^
>> drivers/scsi/lpfc/lpfc_sli.c:19283:14: warning: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
pcmd->virt = dma_pool_alloc(phba->lpfc_drb_pool, GFP_KERNEL,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/lpfc/lpfc_sli.c:19332:3: error: implicit declaration of function 'dma_pool_free' [-Werror,-Wimplicit-function-declaration]
dma_pool_free(phba->lpfc_drb_pool, pcmd->virt, pcmd->phys);
^
drivers/scsi/lpfc/lpfc_sli.c:22226:18: error: implicit declaration of function 'dma_pool_alloc' [-Werror,-Wimplicit-function-declaration]
tmp->dma_sgl = dma_pool_alloc(phba->lpfc_sg_dma_buf_pool,
^
>> drivers/scsi/lpfc/lpfc_sli.c:22226:16: warning: incompatible integer to pointer conversion assigning to 'struct sli4_sge *' from 'int' [-Wint-conversion]
tmp->dma_sgl = dma_pool_alloc(phba->lpfc_sg_dma_buf_pool,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/lpfc/lpfc_sli.c:22312:3: error: implicit declaration of function 'dma_pool_free' [-Werror,-Wimplicit-function-declaration]
dma_pool_free(phba->lpfc_sg_dma_buf_pool,
^
drivers/scsi/lpfc/lpfc_sli.c:22369:19: error: implicit declaration of function 'dma_pool_alloc' [-Werror,-Wimplicit-function-declaration]
tmp->fcp_cmnd = dma_pool_alloc(phba->lpfc_cmd_rsp_buf_pool,
^
>> drivers/scsi/lpfc/lpfc_sli.c:22369:17: warning: incompatible integer to pointer conversion assigning to 'struct fcp_cmnd *' from 'int' [-Wint-conversion]
tmp->fcp_cmnd = dma_pool_alloc(phba->lpfc_cmd_rsp_buf_pool,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/lpfc/lpfc_sli.c:22462:3: error: implicit declaration of function 'dma_pool_free' [-Werror,-Wimplicit-function-declaration]
dma_pool_free(phba->lpfc_cmd_rsp_buf_pool,
^
4 warnings and 7 errors generated.
--
>> drivers/scsi/lpfc/lpfc_init.c:3804:3: error: implicit declaration of function 'dma_pool_free' [-Werror,-Wimplicit-function-declaration]
dma_pool_free(phba->lpfc_sg_dma_buf_pool, sb->data,
^
drivers/scsi/lpfc/lpfc_init.c:3804:3: note: did you mean 'mempool_free'?
include/linux/mempool.h:49:13: note: 'mempool_free' declared here
extern void mempool_free(void *element, mempool_t *pool);
^
drivers/scsi/lpfc/lpfc_init.c:3815:3: error: implicit declaration of function 'dma_pool_free' [-Werror,-Wimplicit-function-declaration]
dma_pool_free(phba->lpfc_sg_dma_buf_pool, sb->data,
^
drivers/scsi/lpfc/lpfc_init.c:3848:4: error: implicit declaration of function 'dma_pool_free' [-Werror,-Wimplicit-function-declaration]
dma_pool_free(phba->lpfc_sg_dma_buf_pool,
^
drivers/scsi/lpfc/lpfc_init.c:3864:4: error: implicit declaration of function 'dma_pool_free' [-Werror,-Wimplicit-function-declaration]
dma_pool_free(phba->lpfc_sg_dma_buf_pool,
^
drivers/scsi/lpfc/lpfc_init.c:4260:5: error: implicit declaration of function 'dma_pool_free' [-Werror,-Wimplicit-function-declaration]
dma_pool_free(phba->lpfc_sg_dma_buf_pool,
^
>> drivers/scsi/lpfc/lpfc_init.c:4330:21: error: implicit declaration of function 'dma_pool_zalloc' [-Werror,-Wimplicit-function-declaration]
lpfc_ncmd->data = dma_pool_zalloc(phba->lpfc_sg_dma_buf_pool,
^
drivers/scsi/lpfc/lpfc_init.c:4330:21: note: did you mean 'mempool_alloc'?
include/linux/mempool.h:48:14: note: 'mempool_alloc' declared here
extern void *mempool_alloc(mempool_t *pool, gfp_t gfp_mask) __malloc;
^
>> drivers/scsi/lpfc/lpfc_init.c:4330:19: warning: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
lpfc_ncmd->data = dma_pool_zalloc(phba->lpfc_sg_dma_buf_pool,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/lpfc/lpfc_init.c:4353:5: error: implicit declaration of function 'dma_pool_free' [-Werror,-Wimplicit-function-declaration]
dma_pool_free(phba->lpfc_sg_dma_buf_pool,
^
drivers/scsi/lpfc/lpfc_init.c:4365:4: error: implicit declaration of function 'dma_pool_free' [-Werror,-Wimplicit-function-declaration]
dma_pool_free(phba->lpfc_sg_dma_buf_pool,
^
drivers/scsi/lpfc/lpfc_init.c:4375:4: error: implicit declaration of function 'dma_pool_free' [-Werror,-Wimplicit-function-declaration]
dma_pool_free(phba->lpfc_sg_dma_buf_pool,
^
>> drivers/scsi/lpfc/lpfc_init.c:7686:3: error: implicit declaration of function 'dma_pool_create' [-Werror,-Wimplicit-function-declaration]
dma_pool_create("lpfc_sg_dma_buf_pool",
^
drivers/scsi/lpfc/lpfc_init.c:7686:3: note: did you mean 'mempool_create'?
include/linux/mempool.h:40:19: note: 'mempool_create' declared here
extern mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn,
^
>> drivers/scsi/lpfc/lpfc_init.c:7685:29: warning: incompatible integer to pointer conversion assigning to 'struct dma_pool *' from 'int' [-Wint-conversion]
phba->lpfc_sg_dma_buf_pool =
^
drivers/scsi/lpfc/lpfc_init.c:7693:30: warning: incompatible integer to pointer conversion assigning to 'struct dma_pool *' from 'int' [-Wint-conversion]
phba->lpfc_cmd_rsp_buf_pool =
^
>> drivers/scsi/lpfc/lpfc_init.c:7723:2: error: implicit declaration of function 'dma_pool_destroy' [-Werror,-Wimplicit-function-declaration]
dma_pool_destroy(phba->lpfc_sg_dma_buf_pool);
^
drivers/scsi/lpfc/lpfc_init.c:7723:2: note: did you mean 'mempool_destroy'?
include/linux/mempool.h:47:13: note: 'mempool_destroy' declared here
extern void mempool_destroy(mempool_t *pool);
^
drivers/scsi/lpfc/lpfc_init.c:8139:4: error: implicit declaration of function 'dma_pool_create' [-Werror,-Wimplicit-function-declaration]
dma_pool_create("lpfc_sg_dma_buf_pool",
^
drivers/scsi/lpfc/lpfc_init.c:8138:29: warning: incompatible integer to pointer conversion assigning to 'struct dma_pool *' from 'int' [-Wint-conversion]
phba->lpfc_sg_dma_buf_pool =
^
drivers/scsi/lpfc/lpfc_init.c:8146:30: warning: incompatible integer to pointer conversion assigning to 'struct dma_pool *' from 'int' [-Wint-conversion]
phba->lpfc_cmd_rsp_buf_pool =
^
drivers/scsi/lpfc/lpfc_init.c:8300:2: error: implicit declaration of function 'dma_pool_destroy' [-Werror,-Wimplicit-function-declaration]
dma_pool_destroy(phba->lpfc_cmd_rsp_buf_pool);
^
5 warnings and 13 errors generated.
--
>> drivers/scsi/lpfc/lpfc_scsi.c:349:15: error: implicit declaration of function 'dma_pool_zalloc' [-Werror,-Wimplicit-function-declaration]
psb->data = dma_pool_zalloc(phba->lpfc_sg_dma_buf_pool,
^
drivers/scsi/lpfc/lpfc_scsi.c:349:15: note: did you mean 'mempool_alloc'?
include/linux/mempool.h:48:14: note: 'mempool_alloc' declared here
extern void *mempool_alloc(mempool_t *pool, gfp_t gfp_mask) __malloc;
^
>> drivers/scsi/lpfc/lpfc_scsi.c:349:13: warning: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
psb->data = dma_pool_zalloc(phba->lpfc_sg_dma_buf_pool,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/lpfc/lpfc_scsi.c:360:4: error: implicit declaration of function 'dma_pool_free' [-Werror,-Wimplicit-function-declaration]
dma_pool_free(phba->lpfc_sg_dma_buf_pool,
^
drivers/scsi/lpfc/lpfc_scsi.c:360:4: note: did you mean 'mempool_free'?
include/linux/mempool.h:49:13: note: 'mempool_free' declared here
extern void mempool_free(void *element, mempool_t *pool);
^
1 warning and 2 errors generated.
--
>> drivers/net/ethernet/alacritech/slicoss.c:852:18: error: implicit declaration of function 'dma_pool_create' [-Werror,-Wimplicit-function-declaration]
txq->dma_pool = dma_pool_create("slic_pool", &sdev->pdev->dev,
^
drivers/net/ethernet/alacritech/slicoss.c:852:18: note: did you mean 'page_pool_create'?
include/net/page_pool.h:169:19: note: 'page_pool_create' declared here
struct page_pool *page_pool_create(const struct page_pool_params *params);
^
>> drivers/net/ethernet/alacritech/slicoss.c:852:16: warning: incompatible integer to pointer conversion assigning to 'struct dma_pool *' from 'int' [-Wint-conversion]
txq->dma_pool = dma_pool_create("slic_pool", &sdev->pdev->dev,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/ethernet/alacritech/slicoss.c:863:10: error: implicit declaration of function 'dma_pool_zalloc' [-Werror,-Wimplicit-function-declaration]
desc = dma_pool_zalloc(txq->dma_pool, GFP_KERNEL,
^
>> drivers/net/ethernet/alacritech/slicoss.c:863:8: warning: incompatible integer to pointer conversion assigning to 'struct slic_tx_desc *' from 'int' [-Wint-conversion]
desc = dma_pool_zalloc(txq->dma_pool, GFP_KERNEL,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/ethernet/alacritech/slicoss.c:884:3: error: implicit declaration of function 'dma_pool_free' [-Werror,-Wimplicit-function-declaration]
dma_pool_free(txq->dma_pool, buff->desc, buff->desc_paddr);
^
drivers/net/ethernet/alacritech/slicoss.c:884:3: note: did you mean 'dma_pool_create'?
drivers/net/ethernet/alacritech/slicoss.c:852:18: note: 'dma_pool_create' declared here
txq->dma_pool = dma_pool_create("slic_pool", &sdev->pdev->dev,
^
>> drivers/net/ethernet/alacritech/slicoss.c:886:2: error: implicit declaration of function 'dma_pool_destroy' [-Werror,-Wimplicit-function-declaration]
dma_pool_destroy(txq->dma_pool);
^
drivers/net/ethernet/alacritech/slicoss.c:886:2: note: did you mean 'page_pool_destroy'?
include/net/page_pool.h:172:6: note: 'page_pool_destroy' declared here
void page_pool_destroy(struct page_pool *pool);
^
drivers/net/ethernet/alacritech/slicoss.c:902:3: error: implicit declaration of function 'dma_pool_free' [-Werror,-Wimplicit-function-declaration]
dma_pool_free(txq->dma_pool, buff->desc, buff->desc_paddr);
^
drivers/net/ethernet/alacritech/slicoss.c:911:2: error: implicit declaration of function 'dma_pool_destroy' [-Werror,-Wimplicit-function-declaration]
dma_pool_destroy(txq->dma_pool);
^
2 warnings and 6 errors generated.
vim +/dma_pool_create +92 drivers/scsi/lpfc/lpfc_mem.c
2e0fef85e098f6 James Smart 2007-06-17 68
e59058c44025d7 James Smart 2008-08-24 69 /**
3621a710a7dbb2 James Smart 2009-04-06 70 * lpfc_mem_alloc - create and allocate all PCI and memory pools
e59058c44025d7 James Smart 2008-08-24 71 * @phba: HBA to allocate pools for
c734de98a7bc3d Lee Jones 2020-07-21 72 * @align: alignment requirement for blocks; must be a power of two
e59058c44025d7 James Smart 2008-08-24 73 *
d79c9e9d4b3d93 James Smart 2019-08-14 74 * Description: Creates and allocates PCI pools lpfc_mbuf_pool,
d79c9e9d4b3d93 James Smart 2019-08-14 75 * lpfc_hrb_pool. Creates and allocates kmalloc-backed mempools
e59058c44025d7 James Smart 2008-08-24 76 * for LPFC_MBOXQ_t and lpfc_nodelist. Also allocates the VPI bitmask.
e59058c44025d7 James Smart 2008-08-24 77 *
e59058c44025d7 James Smart 2008-08-24 78 * Notes: Not interrupt-safe. Must be called with no locks held. If any
e59058c44025d7 James Smart 2008-08-24 79 * allocation fails, frees all successfully allocated memory before returning.
e59058c44025d7 James Smart 2008-08-24 80 *
e59058c44025d7 James Smart 2008-08-24 81 * Returns:
e59058c44025d7 James Smart 2008-08-24 82 * 0 on success
e59058c44025d7 James Smart 2008-08-24 83 * -ENOMEM on failure (if any memory allocations fail)
e59058c44025d7 James Smart 2008-08-24 84 **/
dea3101e0a5c89 James Bottomley 2005-04-17 85 int
da0436e915a5c1 James Smart 2009-05-22 86 lpfc_mem_alloc(struct lpfc_hba *phba, int align)
dea3101e0a5c89 James Bottomley 2005-04-17 87 {
dea3101e0a5c89 James Bottomley 2005-04-17 88 struct lpfc_dma_pool *pool = &phba->lpfc_mbuf_safety_pool;
dea3101e0a5c89 James Bottomley 2005-04-17 89 int i;
dea3101e0a5c89 James Bottomley 2005-04-17 90
dea3101e0a5c89 James Bottomley 2005-04-17 91
771db5c0e3f5da Romain Perier 2017-07-06 @92 phba->lpfc_mbuf_pool = dma_pool_create("lpfc_mbuf_pool", &phba->pcidev->dev,
da0436e915a5c1 James Smart 2009-05-22 93 LPFC_BPL_SIZE,
da0436e915a5c1 James Smart 2009-05-22 94 align, 0);
dea3101e0a5c89 James Bottomley 2005-04-17 95 if (!phba->lpfc_mbuf_pool)
d79c9e9d4b3d93 James Smart 2019-08-14 96 goto fail;
dea3101e0a5c89 James Bottomley 2005-04-17 97
6da2ec56059c3c Kees Cook 2018-06-12 98 pool->elements = kmalloc_array(LPFC_MBUF_POOL_SIZE,
6da2ec56059c3c Kees Cook 2018-06-12 99 sizeof(struct lpfc_dmabuf),
6da2ec56059c3c Kees Cook 2018-06-12 100 GFP_KERNEL);
a96e0c7798057d Mariusz Kozlowski 2007-01-02 101 if (!pool->elements)
a96e0c7798057d Mariusz Kozlowski 2007-01-02 102 goto fail_free_lpfc_mbuf_pool;
a96e0c7798057d Mariusz Kozlowski 2007-01-02 103
dea3101e0a5c89 James Bottomley 2005-04-17 104 pool->max_count = 0;
dea3101e0a5c89 James Bottomley 2005-04-17 105 pool->current_count = 0;
dea3101e0a5c89 James Bottomley 2005-04-17 106 for ( i = 0; i < LPFC_MBUF_POOL_SIZE; i++) {
771db5c0e3f5da Romain Perier 2017-07-06 @107 pool->elements[i].virt = dma_pool_alloc(phba->lpfc_mbuf_pool,
dea3101e0a5c89 James Bottomley 2005-04-17 108 GFP_KERNEL, &pool->elements[i].phys);
dea3101e0a5c89 James Bottomley 2005-04-17 109 if (!pool->elements[i].virt)
dea3101e0a5c89 James Bottomley 2005-04-17 110 goto fail_free_mbuf_pool;
dea3101e0a5c89 James Bottomley 2005-04-17 111 pool->max_count++;
dea3101e0a5c89 James Bottomley 2005-04-17 112 pool->current_count++;
dea3101e0a5c89 James Bottomley 2005-04-17 113 }
dea3101e0a5c89 James Bottomley 2005-04-17 114
e7dab164a9aa45 James Smart 2020-10-20 115 phba->mbox_mem_pool = mempool_create_kmalloc_pool(LPFC_MBX_POOL_SIZE,
0eaae62abaa1ad Matthew Dobson 2006-03-26 116 sizeof(LPFC_MBOXQ_t));
dea3101e0a5c89 James Bottomley 2005-04-17 117 if (!phba->mbox_mem_pool)
dea3101e0a5c89 James Bottomley 2005-04-17 118 goto fail_free_mbuf_pool;
dea3101e0a5c89 James Bottomley 2005-04-17 119
0eaae62abaa1ad Matthew Dobson 2006-03-26 120 phba->nlp_mem_pool = mempool_create_kmalloc_pool(LPFC_MEM_POOL_SIZE,
0eaae62abaa1ad Matthew Dobson 2006-03-26 121 sizeof(struct lpfc_nodelist));
dea3101e0a5c89 James Bottomley 2005-04-17 122 if (!phba->nlp_mem_pool)
dea3101e0a5c89 James Bottomley 2005-04-17 123 goto fail_free_mbox_pool;
8568a4d2495ebc James Smart 2009-07-19 124
8568a4d2495ebc James Smart 2009-07-19 125 if (phba->sli_rev == LPFC_SLI_REV4) {
19ca760979e4be James Smart 2010-11-20 126 phba->rrq_pool =
9dace1fa91ca41 Dick Kennedy 2020-06-30 127 mempool_create_kmalloc_pool(LPFC_RRQ_POOL_SIZE,
19ca760979e4be James Smart 2010-11-20 128 sizeof(struct lpfc_node_rrq));
19ca760979e4be James Smart 2010-11-20 129 if (!phba->rrq_pool)
19ca760979e4be James Smart 2010-11-20 130 goto fail_free_nlp_mem_pool;
771db5c0e3f5da Romain Perier 2017-07-06 131 phba->lpfc_hrb_pool = dma_pool_create("lpfc_hrb_pool",
771db5c0e3f5da Romain Perier 2017-07-06 132 &phba->pcidev->dev,
da0436e915a5c1 James Smart 2009-05-22 133 LPFC_HDR_BUF_SIZE, align, 0);
da0436e915a5c1 James Smart 2009-05-22 134 if (!phba->lpfc_hrb_pool)
19ca760979e4be James Smart 2010-11-20 135 goto fail_free_rrq_mem_pool;
8568a4d2495ebc James Smart 2009-07-19 136
771db5c0e3f5da Romain Perier 2017-07-06 137 phba->lpfc_drb_pool = dma_pool_create("lpfc_drb_pool",
771db5c0e3f5da Romain Perier 2017-07-06 138 &phba->pcidev->dev,
da0436e915a5c1 James Smart 2009-05-22 139 LPFC_DATA_BUF_SIZE, align, 0);
da0436e915a5c1 James Smart 2009-05-22 140 if (!phba->lpfc_drb_pool)
8568a4d2495ebc James Smart 2009-07-19 141 goto fail_free_hrb_pool;
8568a4d2495ebc James Smart 2009-07-19 142 phba->lpfc_hbq_pool = NULL;
8568a4d2495ebc James Smart 2009-07-19 143 } else {
771db5c0e3f5da Romain Perier 2017-07-06 144 phba->lpfc_hbq_pool = dma_pool_create("lpfc_hbq_pool",
771db5c0e3f5da Romain Perier 2017-07-06 145 &phba->pcidev->dev, LPFC_BPL_SIZE, align, 0);
8568a4d2495ebc James Smart 2009-07-19 146 if (!phba->lpfc_hbq_pool)
8568a4d2495ebc James Smart 2009-07-19 147 goto fail_free_nlp_mem_pool;
8568a4d2495ebc James Smart 2009-07-19 148 phba->lpfc_hrb_pool = NULL;
8568a4d2495ebc James Smart 2009-07-19 149 phba->lpfc_drb_pool = NULL;
8568a4d2495ebc James Smart 2009-07-19 150 }
92d7f7b0cde3ad James Smart 2007-06-17 151
1ba981fd3ad1f9 James Smart 2014-02-20 152 if (phba->cfg_EnableXLane) {
1ba981fd3ad1f9 James Smart 2014-02-20 153 phba->device_data_mem_pool = mempool_create_kmalloc_pool(
1ba981fd3ad1f9 James Smart 2014-02-20 154 LPFC_DEVICE_DATA_POOL_SIZE,
1ba981fd3ad1f9 James Smart 2014-02-20 155 sizeof(struct lpfc_device_data));
1ba981fd3ad1f9 James Smart 2014-02-20 156 if (!phba->device_data_mem_pool)
895427bd012ce5 James Smart 2017-02-12 157 goto fail_free_drb_pool;
1ba981fd3ad1f9 James Smart 2014-02-20 158 } else {
1ba981fd3ad1f9 James Smart 2014-02-20 159 phba->device_data_mem_pool = NULL;
1ba981fd3ad1f9 James Smart 2014-02-20 160 }
1ba981fd3ad1f9 James Smart 2014-02-20 161
dea3101e0a5c89 James Bottomley 2005-04-17 162 return 0;
895427bd012ce5 James Smart 2017-02-12 163 fail_free_drb_pool:
771db5c0e3f5da Romain Perier 2017-07-06 @164 dma_pool_destroy(phba->lpfc_drb_pool);
895427bd012ce5 James Smart 2017-02-12 165 phba->lpfc_drb_pool = NULL;
8568a4d2495ebc James Smart 2009-07-19 166 fail_free_hrb_pool:
771db5c0e3f5da Romain Perier 2017-07-06 167 dma_pool_destroy(phba->lpfc_hrb_pool);
da0436e915a5c1 James Smart 2009-05-22 168 phba->lpfc_hrb_pool = NULL;
19ca760979e4be James Smart 2010-11-20 169 fail_free_rrq_mem_pool:
19ca760979e4be James Smart 2010-11-20 170 mempool_destroy(phba->rrq_pool);
19ca760979e4be James Smart 2010-11-20 171 phba->rrq_pool = NULL;
ed957684294618 James Smart 2007-06-17 172 fail_free_nlp_mem_pool:
ed957684294618 James Smart 2007-06-17 173 mempool_destroy(phba->nlp_mem_pool);
ed957684294618 James Smart 2007-06-17 174 phba->nlp_mem_pool = NULL;
dea3101e0a5c89 James Bottomley 2005-04-17 175 fail_free_mbox_pool:
dea3101e0a5c89 James Bottomley 2005-04-17 176 mempool_destroy(phba->mbox_mem_pool);
2e0fef85e098f6 James Smart 2007-06-17 177 phba->mbox_mem_pool = NULL;
dea3101e0a5c89 James Bottomley 2005-04-17 178 fail_free_mbuf_pool:
a96e0c7798057d Mariusz Kozlowski 2007-01-02 179 while (i--)
771db5c0e3f5da Romain Perier 2017-07-06 @180 dma_pool_free(phba->lpfc_mbuf_pool, pool->elements[i].virt,
dea3101e0a5c89 James Bottomley 2005-04-17 181 pool->elements[i].phys);
dea3101e0a5c89 James Bottomley 2005-04-17 182 kfree(pool->elements);
a96e0c7798057d Mariusz Kozlowski 2007-01-02 183 fail_free_lpfc_mbuf_pool:
771db5c0e3f5da Romain Perier 2017-07-06 184 dma_pool_destroy(phba->lpfc_mbuf_pool);
2e0fef85e098f6 James Smart 2007-06-17 185 phba->lpfc_mbuf_pool = NULL;
dea3101e0a5c89 James Bottomley 2005-04-17 186 fail:
dea3101e0a5c89 James Bottomley 2005-04-17 187 return -ENOMEM;
dea3101e0a5c89 James Bottomley 2005-04-17 188 }
dea3101e0a5c89 James Bottomley 2005-04-17 189
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
11 months, 1 week
Re: [PATCH] PCI: Remove the unused pci wrappers pci_pool_xxx()
by kernel test robot
Hi Cai,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on helgaas-pci/next]
[also build test ERROR on v5.15-rc6 next-20211018]
[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/Cai-Huoqing/PCI-Remove-the-unuse...
base: https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next
config: i386-randconfig-a014-20211018 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d245f2e8597bfb52c34810a328d42b990e4af1a4)
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/0day-ci/linux/commit/35cdbe7c76652cc75a170ef91c4dafac9...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Cai-Huoqing/PCI-Remove-the-unused-pci-wrappers-pci_pool_xxx/20211018-161828
git checkout 35cdbe7c76652cc75a170ef91c4dafac9773e8c0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
>> drivers/misc/habanalabs/goya/goya.c:919:19: error: implicit declaration of function 'dma_pool_create' [-Werror,-Wimplicit-function-declaration]
hdev->dma_pool = dma_pool_create(dev_name(hdev->dev),
^
drivers/misc/habanalabs/goya/goya.c:919:19: note: did you mean 'gen_pool_create'?
include/linux/genalloc.h:96:25: note: 'gen_pool_create' declared here
extern struct gen_pool *gen_pool_create(int, int);
^
>> drivers/misc/habanalabs/goya/goya.c:919:17: warning: incompatible integer to pointer conversion assigning to 'struct dma_pool *' from 'int' [-Wint-conversion]
hdev->dma_pool = dma_pool_create(dev_name(hdev->dev),
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/misc/habanalabs/goya/goya.c:977:2: error: implicit declaration of function 'dma_pool_destroy' [-Werror,-Wimplicit-function-declaration]
dma_pool_destroy(hdev->dma_pool);
^
drivers/misc/habanalabs/goya/goya.c:977:2: note: did you mean 'gen_pool_destroy'?
include/linux/genalloc.h:124:13: note: 'gen_pool_destroy' declared here
extern void gen_pool_destroy(struct gen_pool *);
^
drivers/misc/habanalabs/goya/goya.c:1001:2: error: implicit declaration of function 'dma_pool_destroy' [-Werror,-Wimplicit-function-declaration]
dma_pool_destroy(hdev->dma_pool);
^
>> drivers/misc/habanalabs/goya/goya.c:3184:17: error: implicit declaration of function 'dma_pool_zalloc' [-Werror,-Wimplicit-function-declaration]
kernel_addr = dma_pool_zalloc(hdev->dma_pool, mem_flags, dma_handle);
^
drivers/misc/habanalabs/goya/goya.c:3184:17: note: did you mean 'gen_pool_alloc'?
include/linux/genalloc.h:151:29: note: 'gen_pool_alloc' declared here
static inline unsigned long gen_pool_alloc(struct gen_pool *pool, size_t size)
^
>> drivers/misc/habanalabs/goya/goya.c:3184:14: warning: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
kernel_addr = dma_pool_zalloc(hdev->dma_pool, mem_flags, dma_handle);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/misc/habanalabs/goya/goya.c:3199:2: error: implicit declaration of function 'dma_pool_free' [-Werror,-Wimplicit-function-declaration]
dma_pool_free(hdev->dma_pool, vaddr, fixed_dma_addr);
^
drivers/misc/habanalabs/goya/goya.c:3199:2: note: did you mean 'gen_pool_free'?
include/linux/genalloc.h:169:20: note: 'gen_pool_free' declared here
static inline void gen_pool_free(struct gen_pool *pool, unsigned long addr,
^
2 warnings and 5 errors generated.
--
>> drivers/misc/habanalabs/gaudi/gaudi.c:1845:19: error: implicit declaration of function 'dma_pool_create' [-Werror,-Wimplicit-function-declaration]
hdev->dma_pool = dma_pool_create(dev_name(hdev->dev),
^
drivers/misc/habanalabs/gaudi/gaudi.c:1845:19: note: did you mean 'gen_pool_create'?
include/linux/genalloc.h:96:25: note: 'gen_pool_create' declared here
extern struct gen_pool *gen_pool_create(int, int);
^
>> drivers/misc/habanalabs/gaudi/gaudi.c:1845:17: warning: incompatible integer to pointer conversion assigning to 'struct dma_pool *' from 'int' [-Wint-conversion]
hdev->dma_pool = dma_pool_create(dev_name(hdev->dev),
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/misc/habanalabs/gaudi/gaudi.c:1905:2: error: implicit declaration of function 'dma_pool_destroy' [-Werror,-Wimplicit-function-declaration]
dma_pool_destroy(hdev->dma_pool);
^
drivers/misc/habanalabs/gaudi/gaudi.c:1905:2: note: did you mean 'gen_pool_destroy'?
include/linux/genalloc.h:124:13: note: 'gen_pool_destroy' declared here
extern void gen_pool_destroy(struct gen_pool *);
^
drivers/misc/habanalabs/gaudi/gaudi.c:1928:2: error: implicit declaration of function 'dma_pool_destroy' [-Werror,-Wimplicit-function-declaration]
dma_pool_destroy(hdev->dma_pool);
^
>> drivers/misc/habanalabs/gaudi/gaudi.c:5057:16: error: implicit declaration of function 'dma_pool_zalloc' [-Werror,-Wimplicit-function-declaration]
kernel_addr = dma_pool_zalloc(hdev->dma_pool, mem_flags, dma_handle);
^
drivers/misc/habanalabs/gaudi/gaudi.c:5057:16: note: did you mean 'gen_pool_alloc'?
include/linux/genalloc.h:151:29: note: 'gen_pool_alloc' declared here
static inline unsigned long gen_pool_alloc(struct gen_pool *pool, size_t size)
^
>> drivers/misc/habanalabs/gaudi/gaudi.c:5057:14: warning: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
kernel_addr = dma_pool_zalloc(hdev->dma_pool, mem_flags, dma_handle);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/misc/habanalabs/gaudi/gaudi.c:5072:2: error: implicit declaration of function 'dma_pool_free' [-Werror,-Wimplicit-function-declaration]
dma_pool_free(hdev->dma_pool, vaddr, fixed_dma_addr);
^
drivers/misc/habanalabs/gaudi/gaudi.c:5072:2: note: did you mean 'gen_pool_free'?
include/linux/genalloc.h:169:20: note: 'gen_pool_free' declared here
static inline void gen_pool_free(struct gen_pool *pool, unsigned long addr,
^
2 warnings and 5 errors generated.
vim +/dma_pool_create +919 drivers/misc/habanalabs/goya/goya.c
c592c270fe1f24 Ohad Sharabi 2021-04-21 892
99b9d7b4970cf1 Oded Gabbay 2019-02-16 893 /*
99b9d7b4970cf1 Oded Gabbay 2019-02-16 894 * goya_sw_init - Goya software initialization code
99b9d7b4970cf1 Oded Gabbay 2019-02-16 895 *
99b9d7b4970cf1 Oded Gabbay 2019-02-16 896 * @hdev: pointer to hl_device structure
99b9d7b4970cf1 Oded Gabbay 2019-02-16 897 *
99b9d7b4970cf1 Oded Gabbay 2019-02-16 898 */
99b9d7b4970cf1 Oded Gabbay 2019-02-16 899 static int goya_sw_init(struct hl_device *hdev)
99b9d7b4970cf1 Oded Gabbay 2019-02-16 900 {
99b9d7b4970cf1 Oded Gabbay 2019-02-16 901 struct goya_device *goya;
99b9d7b4970cf1 Oded Gabbay 2019-02-16 902 int rc;
99b9d7b4970cf1 Oded Gabbay 2019-02-16 903
99b9d7b4970cf1 Oded Gabbay 2019-02-16 904 /* Allocate device structure */
99b9d7b4970cf1 Oded Gabbay 2019-02-16 905 goya = kzalloc(sizeof(*goya), GFP_KERNEL);
99b9d7b4970cf1 Oded Gabbay 2019-02-16 906 if (!goya)
99b9d7b4970cf1 Oded Gabbay 2019-02-16 907 return -ENOMEM;
99b9d7b4970cf1 Oded Gabbay 2019-02-16 908
99b9d7b4970cf1 Oded Gabbay 2019-02-16 909 /* according to goya_init_iatu */
99b9d7b4970cf1 Oded Gabbay 2019-02-16 910 goya->ddr_bar_cur_addr = DRAM_PHYS_BASE;
d91389bc839d72 Oded Gabbay 2019-02-16 911
d91389bc839d72 Oded Gabbay 2019-02-16 912 goya->mme_clk = GOYA_PLL_FREQ_LOW;
d91389bc839d72 Oded Gabbay 2019-02-16 913 goya->tpc_clk = GOYA_PLL_FREQ_LOW;
d91389bc839d72 Oded Gabbay 2019-02-16 914 goya->ic_clk = GOYA_PLL_FREQ_LOW;
d91389bc839d72 Oded Gabbay 2019-02-16 915
99b9d7b4970cf1 Oded Gabbay 2019-02-16 916 hdev->asic_specific = goya;
99b9d7b4970cf1 Oded Gabbay 2019-02-16 917
99b9d7b4970cf1 Oded Gabbay 2019-02-16 918 /* Create DMA pool for small allocations */
99b9d7b4970cf1 Oded Gabbay 2019-02-16 @919 hdev->dma_pool = dma_pool_create(dev_name(hdev->dev),
99b9d7b4970cf1 Oded Gabbay 2019-02-16 920 &hdev->pdev->dev, GOYA_DMA_POOL_BLK_SIZE, 8, 0);
99b9d7b4970cf1 Oded Gabbay 2019-02-16 921 if (!hdev->dma_pool) {
99b9d7b4970cf1 Oded Gabbay 2019-02-16 922 dev_err(hdev->dev, "failed to create DMA pool\n");
99b9d7b4970cf1 Oded Gabbay 2019-02-16 923 rc = -ENOMEM;
99b9d7b4970cf1 Oded Gabbay 2019-02-16 924 goto free_goya_device;
99b9d7b4970cf1 Oded Gabbay 2019-02-16 925 }
99b9d7b4970cf1 Oded Gabbay 2019-02-16 926
99b9d7b4970cf1 Oded Gabbay 2019-02-16 927 hdev->cpu_accessible_dma_mem =
d9c3aa8038c391 Oded Gabbay 2019-05-01 928 hdev->asic_funcs->asic_dma_alloc_coherent(hdev,
3110c60fdc7a5a Tomer Tayar 2019-03-04 929 HL_CPU_ACCESSIBLE_MEM_SIZE,
99b9d7b4970cf1 Oded Gabbay 2019-02-16 930 &hdev->cpu_accessible_dma_address,
99b9d7b4970cf1 Oded Gabbay 2019-02-16 931 GFP_KERNEL | __GFP_ZERO);
99b9d7b4970cf1 Oded Gabbay 2019-02-16 932
99b9d7b4970cf1 Oded Gabbay 2019-02-16 933 if (!hdev->cpu_accessible_dma_mem) {
99b9d7b4970cf1 Oded Gabbay 2019-02-16 934 rc = -ENOMEM;
99b9d7b4970cf1 Oded Gabbay 2019-02-16 935 goto free_dma_pool;
99b9d7b4970cf1 Oded Gabbay 2019-02-16 936 }
99b9d7b4970cf1 Oded Gabbay 2019-02-16 937
f62fa0ced46afc Arnd Bergmann 2019-07-08 938 dev_dbg(hdev->dev, "cpu accessible memory at bus address %pad\n",
f62fa0ced46afc Arnd Bergmann 2019-07-08 939 &hdev->cpu_accessible_dma_address);
2a51558c8c7f82 Oded Gabbay 2019-05-29 940
cbb10f1e4a7225 Oded Gabbay 2019-05-17 941 hdev->cpu_accessible_dma_pool = gen_pool_create(ilog2(32), -1);
99b9d7b4970cf1 Oded Gabbay 2019-02-16 942 if (!hdev->cpu_accessible_dma_pool) {
99b9d7b4970cf1 Oded Gabbay 2019-02-16 943 dev_err(hdev->dev,
99b9d7b4970cf1 Oded Gabbay 2019-02-16 944 "Failed to create CPU accessible DMA pool\n");
99b9d7b4970cf1 Oded Gabbay 2019-02-16 945 rc = -ENOMEM;
9f832fda79eb6e Tomer Tayar 2019-05-02 946 goto free_cpu_dma_mem;
99b9d7b4970cf1 Oded Gabbay 2019-02-16 947 }
99b9d7b4970cf1 Oded Gabbay 2019-02-16 948
99b9d7b4970cf1 Oded Gabbay 2019-02-16 949 rc = gen_pool_add(hdev->cpu_accessible_dma_pool,
99b9d7b4970cf1 Oded Gabbay 2019-02-16 950 (uintptr_t) hdev->cpu_accessible_dma_mem,
3110c60fdc7a5a Tomer Tayar 2019-03-04 951 HL_CPU_ACCESSIBLE_MEM_SIZE, -1);
99b9d7b4970cf1 Oded Gabbay 2019-02-16 952 if (rc) {
99b9d7b4970cf1 Oded Gabbay 2019-02-16 953 dev_err(hdev->dev,
99b9d7b4970cf1 Oded Gabbay 2019-02-16 954 "Failed to add memory to CPU accessible DMA pool\n");
99b9d7b4970cf1 Oded Gabbay 2019-02-16 955 rc = -EFAULT;
ba209e1587227f Tomer Tayar 2019-05-02 956 goto free_cpu_accessible_dma_pool;
99b9d7b4970cf1 Oded Gabbay 2019-02-16 957 }
99b9d7b4970cf1 Oded Gabbay 2019-02-16 958
99b9d7b4970cf1 Oded Gabbay 2019-02-16 959 spin_lock_init(&goya->hw_queues_lock);
9e5e49cd5b90cf Omer Shpigelman 2020-05-10 960 hdev->supports_coresight = true;
66446820df1864 Oded Gabbay 2020-05-18 961 hdev->supports_soft_reset = true;
23bace677a3d92 Ofir Bitton 2021-06-08 962 hdev->allow_external_soft_reset = true;
215f0c1775d550 Ohad Sharabi 2021-06-14 963 hdev->supports_wait_for_multi_cs = false;
99b9d7b4970cf1 Oded Gabbay 2019-02-16 964
b9317d513098d0 Ohad Sharabi 2021-07-15 965 hdev->asic_funcs->set_pci_memory_regions(hdev);
c592c270fe1f24 Ohad Sharabi 2021-04-21 966
99b9d7b4970cf1 Oded Gabbay 2019-02-16 967 return 0;
99b9d7b4970cf1 Oded Gabbay 2019-02-16 968
ba209e1587227f Tomer Tayar 2019-05-02 969 free_cpu_accessible_dma_pool:
99b9d7b4970cf1 Oded Gabbay 2019-02-16 970 gen_pool_destroy(hdev->cpu_accessible_dma_pool);
9f832fda79eb6e Tomer Tayar 2019-05-02 971 free_cpu_dma_mem:
d9c3aa8038c391 Oded Gabbay 2019-05-01 972 hdev->asic_funcs->asic_dma_free_coherent(hdev,
d9c3aa8038c391 Oded Gabbay 2019-05-01 973 HL_CPU_ACCESSIBLE_MEM_SIZE,
99b9d7b4970cf1 Oded Gabbay 2019-02-16 974 hdev->cpu_accessible_dma_mem,
99b9d7b4970cf1 Oded Gabbay 2019-02-16 975 hdev->cpu_accessible_dma_address);
99b9d7b4970cf1 Oded Gabbay 2019-02-16 976 free_dma_pool:
99b9d7b4970cf1 Oded Gabbay 2019-02-16 @977 dma_pool_destroy(hdev->dma_pool);
99b9d7b4970cf1 Oded Gabbay 2019-02-16 978 free_goya_device:
99b9d7b4970cf1 Oded Gabbay 2019-02-16 979 kfree(goya);
99b9d7b4970cf1 Oded Gabbay 2019-02-16 980
99b9d7b4970cf1 Oded Gabbay 2019-02-16 981 return rc;
99b9d7b4970cf1 Oded Gabbay 2019-02-16 982 }
99b9d7b4970cf1 Oded Gabbay 2019-02-16 983
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
11 months, 1 week
Re: [PATCH linux-next] drm/i915/display: Remove unused variable in the for loop.
by kernel test robot
Hi luo,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on next-20211015]
url: https://github.com/0day-ci/linux/commits/luo-penghao/drm-i915-display-Rem...
base: 7c832d2f9b959e3181370c8b0dacaf9efe13fc05
config: x86_64-randconfig-r014-20211018 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d245f2e8597bfb52c34810a328d42b990e4af1a4)
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/0day-ci/linux/commit/1a3c67fc7e245a1130e2b59fe5a04ce82...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review luo-penghao/drm-i915-display-Remove-unused-variable-in-the-for-loop/20211018-164557
git checkout 1a3c67fc7e245a1130e2b59fe5a04ce82de697c0
# 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 errors (new ones prefixed by >>):
>> drivers/gpu/drm/i915/display/intel_fb.c:1018:25: error: expression result unused [-Werror,-Wunused-value]
fb->base.format->cpp[i];
~~~~~~~~~~~~~~~~~~~~ ~^
1 error generated.
vim +1018 drivers/gpu/drm/i915/display/intel_fb.c
977
978 int intel_fill_fb_info(struct drm_i915_private *i915, struct intel_framebuffer *fb)
979 {
980 struct drm_i915_gem_object *obj = intel_fb_obj(&fb->base);
981 u32 gtt_offset_rotated = 0;
982 u32 gtt_offset_remapped = 0;
983 unsigned int max_size = 0;
984 int i, num_planes = fb->base.format->num_planes;
985 unsigned int tile_size = intel_tile_size(i915);
986
987 intel_fb_view_init(i915, &fb->normal_view, I915_GGTT_VIEW_NORMAL);
988
989 drm_WARN_ON(&i915->drm,
990 intel_fb_supports_90_270_rotation(fb) &&
991 intel_fb_needs_pot_stride_remap(fb));
992
993 if (intel_fb_supports_90_270_rotation(fb))
994 intel_fb_view_init(i915, &fb->rotated_view, I915_GGTT_VIEW_ROTATED);
995 if (intel_fb_needs_pot_stride_remap(fb))
996 intel_fb_view_init(i915, &fb->remapped_view, I915_GGTT_VIEW_REMAPPED);
997
998 for (i = 0; i < num_planes; i++) {
999 struct fb_plane_view_dims view_dims;
1000 unsigned int width, height;
1001 unsigned int size;
1002 u32 offset;
1003 int x, y;
1004 int ret;
1005
1006 /*
1007 * Plane 2 of Render Compression with Clear Color fb modifier
1008 * is consumed by the driver and not passed to DE. Skip the
1009 * arithmetic related to alignment and offset calculation.
1010 */
1011 if (is_gen12_ccs_cc_plane(&fb->base, i)) {
1012 if (IS_ALIGNED(fb->base.offsets[i], PAGE_SIZE))
1013 continue;
1014 else
1015 return -EINVAL;
1016 }
1017
> 1018 fb->base.format->cpp[i];
1019 intel_fb_plane_dims(fb, i, &width, &height);
1020
1021 ret = convert_plane_offset_to_xy(fb, i, width, &x, &y);
1022 if (ret)
1023 return ret;
1024
1025 init_plane_view_dims(fb, i, width, height, &view_dims);
1026
1027 /*
1028 * First pixel of the framebuffer from
1029 * the start of the normal gtt mapping.
1030 */
1031 fb->normal_view.color_plane[i].x = x;
1032 fb->normal_view.color_plane[i].y = y;
1033 fb->normal_view.color_plane[i].stride = fb->base.pitches[i];
1034
1035 offset = calc_plane_aligned_offset(fb, i, &x, &y);
1036
1037 if (intel_fb_supports_90_270_rotation(fb))
1038 gtt_offset_rotated += calc_plane_remap_info(fb, i, &view_dims,
1039 offset, gtt_offset_rotated, x, y,
1040 &fb->rotated_view);
1041
1042 if (intel_fb_needs_pot_stride_remap(fb))
1043 gtt_offset_remapped += calc_plane_remap_info(fb, i, &view_dims,
1044 offset, gtt_offset_remapped, x, y,
1045 &fb->remapped_view);
1046
1047 size = calc_plane_normal_size(fb, i, &view_dims, x, y);
1048 /* how many tiles in total needed in the bo */
1049 max_size = max(max_size, offset + size);
1050 }
1051
1052 if (mul_u32_u32(max_size, tile_size) > obj->base.size) {
1053 drm_dbg_kms(&i915->drm,
1054 "fb too big for bo (need %llu bytes, have %zu bytes)\n",
1055 mul_u32_u32(max_size, tile_size), obj->base.size);
1056 return -EINVAL;
1057 }
1058
1059 return 0;
1060 }
1061
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
11 months, 1 week