From: kernel test robot <lkp@intel.com>
To: jasperwang@tencent.com, kaixuxia@tencent.com,
frankjpliu@tencent.com, kasong@tencent.com,
sagazchen@tencent.com, kernelxing@tencent.com,
aurelianliu@tencent.com, jason.zeng@intel.com,
wu.zheng@intel.com, yingbao.jia@intel.com, pei.p.jia@intel.com
Cc: oe-kbuild-all@lists.linux.dev
Subject: [opencloudos:next 61/98] block/blk-cgroup.c:677:40: error: invalid application of 'sizeof' to incomplete type 'struct iocg_pcpu_stat'
Date: Fri, 19 Apr 2024 05:00:10 +0800 [thread overview]
Message-ID: <202404190422.koIM7d2d-lkp@intel.com> (raw)
tree: https://gitee.com/OpenCloudOS/OpenCloudOS-Kernel.git next
head: 1a77a557522cf821eb3cb19959da7093902866ed
commit: 6dfa517032c94097afefeb8c2101f9b90b107cd9 [61/98] blkcg/diskstats: add per blkcg diskstats support
config: x86_64-randconfig-121-20240419 (https://download.01.org/0day-ci/archive/20240419/202404190422.koIM7d2d-lkp@intel.com/config)
compiler: gcc-12 (Ubuntu 12.3.0-9ubuntu2) 12.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240419/202404190422.koIM7d2d-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202404190422.koIM7d2d-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from include/linux/hrtimer.h:19,
from include/linux/sched.h:20,
from include/linux/ioprio.h:5,
from block/blk-cgroup.c:18:
block/blk-cgroup.c: In function 'blkcg_dkstats_alloc':
>> block/blk-cgroup.c:677:40: error: invalid application of 'sizeof' to incomplete type 'struct iocg_pcpu_stat'
677 | ds->dkstats = alloc_percpu_gfp(struct iocg_pcpu_stat, GFP_NOWAIT);
| ^~~~~~
include/linux/percpu.h:141:60: note: in definition of macro 'alloc_percpu_gfp'
141 | (typeof(type) __percpu *)__alloc_percpu_gfp(sizeof(type), \
| ^~~~
>> block/blk-cgroup.c:677:40: error: invalid application of '__alignof__' to incomplete type 'struct iocg_pcpu_stat'
677 | ds->dkstats = alloc_percpu_gfp(struct iocg_pcpu_stat, GFP_NOWAIT);
| ^~~~~~
include/linux/percpu.h:142:61: note: in definition of macro 'alloc_percpu_gfp'
142 | __alignof__(type), gfp)
| ^~~~
>> block/blk-cgroup.c:679:17: error: implicit declaration of function 'free' [-Werror=implicit-function-declaration]
679 | free(ds);
| ^~~~
block/blk-cgroup.c:37:1: note: include '<stdlib.h>' or provide a declaration of 'free'
36 | #include "blk-throttle.h"
+++ |+#include <stdlib.h>
37 |
block/blk-cgroup.c:679:17: warning: incompatible implicit declaration of built-in function 'free' [-Wbuiltin-declaration-mismatch]
679 | free(ds);
| ^~~~
block/blk-cgroup.c:679:17: note: include '<stdlib.h>' or provide a declaration of 'free'
block/blk-cgroup.c:661:23: warning: unused variable 'flags' [-Wunused-variable]
661 | unsigned long flags;
| ^~~~~
cc1: some warnings being treated as errors
vim +677 block/blk-cgroup.c
657
658 static struct blkcg_dkstats *blkcg_dkstats_alloc(struct block_device *bdev)
659 {
660 struct blkcg_dkstats *ds;
661 unsigned long flags;
662
663 /* inside io path, do not consider GFP_KERNEL */
664 ds = kzalloc(sizeof(struct blkcg_dkstats), GFP_ATOMIC);
665 if (!ds)
666 return NULL;
667
668 ds->part = bdev;
669 INIT_LIST_HEAD(&ds->list_node);
670 #ifdef BLK_CGROUP_DISKSTATS_DEFER_ALLOC
671 INIT_LIST_HEAD(&ds->alloc_node);
672 spin_lock_irqsave(&alloc_lock, flags);
673 list_add(&ds->alloc_node, &alloc_list);
674 schedule_delayed_work(&dkstats_alloc_work, 0);
675 spin_unlock_irqrestore(&alloc_lock, flags);
676 #else
> 677 ds->dkstats = alloc_percpu_gfp(struct iocg_pcpu_stat, GFP_NOWAIT);
678 if (!ds->dkstats) {
> 679 free(ds);
680 ds = NULL;
681 }
682 #endif
683 return ds;
684 }
685
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-04-18 21:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202404190422.koIM7d2d-lkp@intel.com \
--to=lkp@intel.com \
--cc=aurelianliu@tencent.com \
--cc=frankjpliu@tencent.com \
--cc=jason.zeng@intel.com \
--cc=jasperwang@tencent.com \
--cc=kaixuxia@tencent.com \
--cc=kasong@tencent.com \
--cc=kernelxing@tencent.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=pei.p.jia@intel.com \
--cc=sagazchen@tencent.com \
--cc=wu.zheng@intel.com \
--cc=yingbao.jia@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.