[openeuler:OLK-6.6 2679/2679] block/blk-cgroup.c:2320:18: warning: no previous prototype for function 'bpf_blkcg_get_dev_iostat'

tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 43d8c124ec4624389b14d42595e5f0195e3e5a1d commit: 969159a7bdeceb8bf814c6e0bf3b5360d9d9b167 [2679/2679] bpf-rvi: blk-cgroup: Add bpf_blkcg_get_dev_iostat() kfunc config: loongarch-allmodconfig (https://download.01.org/0day-ci/archive/20250814/202508142302.3YamVK7A-lkp@i...) compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250814/202508142302.3YamVK7A-lkp@i...) 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/202508142302.3YamVK7A-lkp@intel.com/ All warnings (new ones prefixed by >>):
block/blk-cgroup.c:2320:18: warning: no previous prototype for function 'bpf_blkcg_get_dev_iostat' [-Wmissing-prototypes] 2320 | __bpf_kfunc void bpf_blkcg_get_dev_iostat(struct blkcg *blkcg, int major, int minor, | ^ block/blk-cgroup.c:2320:13: note: declare 'static' if the function is not intended to be used outside of this translation unit 2320 | __bpf_kfunc void bpf_blkcg_get_dev_iostat(struct blkcg *blkcg, int major, int minor, | ^ | static 1 warning generated.
vim +/bpf_blkcg_get_dev_iostat +2320 block/blk-cgroup.c 2306 2307 /* 2308 * Basically inmitating: 2309 * 2310 * - v1: 2311 * - tg_print_rwstat_recursive() in block/blk-throttle.c 2312 * - bfqg_print_rwstat_recursive() in block/bfq-cgroup.c 2313 * - v2: 2314 * - blkcg_print_stat() 2315 * 2316 * without the final printing (e.g. the __blkg_prfill_rwstat() part). 2317 * 2318 * Note that a subsystem can only exist in either cgroup v1 or v2 at the same time. 2319 */
2320 __bpf_kfunc void bpf_blkcg_get_dev_iostat(struct blkcg *blkcg, int major, int minor, 2321 struct blkg_rw_iostat *iostat, bool is_v2) 2322 { 2323 struct blkcg_gq *blkg; 2324 char dev_name[64]; 2325 2326 if (!blkcg || !iostat) 2327 return; 2328 2329 if (is_v2) { 2330 if (blkcg == &blkcg_root) 2331 blkcg_fill_root_iostats(); 2332 else 2333 cgroup_rstat_flush_atomic(blkcg->css.cgroup); 2334 } 2335 2336 snprintf(dev_name, sizeof(dev_name), "%d:%d", major, minor); 2337 rcu_read_lock(); 2338 hlist_for_each_entry_rcu(blkg, &blkcg->blkg_list, blkcg_node) { 2339 if (strcmp(dev_name, blkg_dev_name(blkg))) 2340 continue; 2341 spin_lock_irq(&blkg->q->queue_lock); 2342 if (is_v2) 2343 blkcg_get_one_stat_v2(blkg, iostat); 2344 else 2345 blkcg_get_one_stat_v1(blkg, iostat); 2346 spin_unlock_irq(&blkg->q->queue_lock); 2347 break; 2348 } 2349 rcu_read_unlock(); 2350 } 2351
-- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
participants (1)
-
kernel test robot