oe-kbuild-all.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [opencloudos:next 61/98] block/blk-cgroup.c:677:40: error: invalid application of 'sizeof' to incomplete type 'struct iocg_pcpu_stat'
@ 2024-04-18 21:00 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-04-18 21:00 UTC (permalink / raw
  To: jasperwang, kaixuxia, frankjpliu, kasong, sagazchen, kernelxing,
	aurelianliu, jason.zeng, wu.zheng, yingbao.jia, pei.p.jia
  Cc: oe-kbuild-all

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-04-18 21:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-18 21:00 [opencloudos:next 61/98] block/blk-cgroup.c:677:40: error: invalid application of 'sizeof' to incomplete type 'struct iocg_pcpu_stat' kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).