kernel/bpf/helpers.c:1757:7: warning: no previous declaration for 'bpf_obj_new_impl'

From: kernel test robot
Date: Wed Aug 16 2023 - 11:03:24 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 4853c74bd7ab7fdb83f319bd9ace8a08c031e9b6
commit: 958cf2e273f0929c66169e0788031310e8118722 bpf: Introduce bpf_obj_new
date: 9 months ago
config: x86_64-randconfig-x012-20230816 (https://download.01.org/0day-ci/archive/20230816/202308162255.nWBAw9u6-lkp@xxxxxxxxx/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce: (https://download.01.org/0day-ci/archive/20230816/202308162255.nWBAw9u6-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/202308162255.nWBAw9u6-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> kernel/bpf/helpers.c:1757:7: warning: no previous declaration for 'bpf_obj_new_impl' [-Wmissing-declarations]
void *bpf_obj_new_impl(u64 local_type_id__k, void *meta__ign)
^~~~~~~~~~~~~~~~


vim +/bpf_obj_new_impl +1757 kernel/bpf/helpers.c

1752
1753 __diag_push();
1754 __diag_ignore_all("-Wmissing-prototypes",
1755 "Global functions as their definitions will be in vmlinux BTF");
1756
> 1757 void *bpf_obj_new_impl(u64 local_type_id__k, void *meta__ign)
1758 {
1759 struct btf_struct_meta *meta = meta__ign;
1760 u64 size = local_type_id__k;
1761 void *p;
1762
1763 if (unlikely(!bpf_global_ma_set))
1764 return NULL;
1765 p = bpf_mem_alloc(&bpf_global_ma, size);
1766 if (!p)
1767 return NULL;
1768 if (meta)
1769 bpf_obj_init(meta->field_offs, p);
1770 return p;
1771 }
1772

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