[linux-next:master 530/10518] kernel/bpf/map_iter.c:201:17: warning: no previous declaration for 'bpf_map_sum_elem_count'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   ef66bf8aeb91fd331cf8f5dca8f9d7bca9ab2849
commit: 803370d3d37579e080e8c59f2360a072d0e45aff [530/10518] bpf: add a new kfunc to return current bpf_map elements count
config: x86_64-randconfig-r032-20230816 (https://download.01.org/0day-ci/archive/20230817/202308170007.OzhdwITj-lkp@xxxxxxxxx/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce: (https://download.01.org/0day-ci/archive/20230817/202308170007.OzhdwITj-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308170007.OzhdwITj-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> kernel/bpf/map_iter.c:201:17: warning: no previous declaration for 'bpf_map_sum_elem_count' [-Wmissing-declarations]
    __bpf_kfunc s64 bpf_map_sum_elem_count(struct bpf_map *map)
                    ^~~~~~~~~~~~~~~~~~~~~~


vim +/bpf_map_sum_elem_count +201 kernel/bpf/map_iter.c

   196	
   197	__diag_push();
   198	__diag_ignore_all("-Wmissing-prototypes",
   199			  "Global functions as their definitions will be in vmlinux BTF");
   200	
 > 201	__bpf_kfunc s64 bpf_map_sum_elem_count(struct bpf_map *map)
   202	{
   203		s64 *pcount;
   204		s64 ret = 0;
   205		int cpu;
   206	
   207		if (!map || !map->elem_count)
   208			return 0;
   209	
   210		for_each_possible_cpu(cpu) {
   211			pcount = per_cpu_ptr(map->elem_count, cpu);
   212			ret += READ_ONCE(*pcount);
   213		}
   214		return ret;
   215	}
   216	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux