Re: [ammarfaizi2-block:tj/cgroup/for-next 3/5] kernel/cgroup/cgroup.c:6765: warning: expecting prototype for cgroup_get_from_fd(). Prototype was for cgroup_v1v2_get_from_fd() instead
From: Yosry Ahmed
Date: Tue Oct 11 2022 - 16:42:17 EST
On Tue, Oct 11, 2022 at 1:39 PM kernel test robot <lkp@xxxxxxxxx> wrote:
>
> tree: https://github.com/ammarfaizi2/linux-block tj/cgroup/for-next
> head: 8248fe413216732f98563e8882b6c6ae617c327b
> commit: a6d1ce5951185ee91bbe6909fe2758f3625561b0 [3/5] cgroup: add cgroup_v1v2_get_from_[fd/file]()
> config: m68k-randconfig-r005-20221010
> compiler: m68k-linux-gcc (GCC) 12.1.0
> reproduce (this is a W=1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # https://github.com/ammarfaizi2/linux-block/commit/a6d1ce5951185ee91bbe6909fe2758f3625561b0
> git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
> git fetch --no-tags ammarfaizi2-block tj/cgroup/for-next
> git checkout a6d1ce5951185ee91bbe6909fe2758f3625561b0
> # save the config file
> mkdir build_dir && cp config build_dir/.config
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k SHELL=/bin/bash kernel/cgroup/
>
> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
>
> All warnings (new ones prefixed by >>):
>
> kernel/cgroup/cgroup.c:6251: warning: Function parameter or member 'f' not described in 'cgroup_get_from_file'
> >> kernel/cgroup/cgroup.c:6765: warning: expecting prototype for cgroup_get_from_fd(). Prototype was for cgroup_v1v2_get_from_fd() instead
> kernel/cgroup/cgroup.c:6783: warning: Function parameter or member 'fd' not described in 'cgroup_get_from_fd'
>
>
> vim +6765 kernel/cgroup/cgroup.c
>
> 16af439645455fb kernel/cgroup.c Tejun Heo 2015-11-20 6754
> 1f3fe7ebf6136c3 kernel/cgroup.c Martin KaFai Lau 2016-06-30 6755 /**
> 1f3fe7ebf6136c3 kernel/cgroup.c Martin KaFai Lau 2016-06-30 6756 * cgroup_get_from_fd - get a cgroup pointer from a fd
Ugh I forgot to update this line in the comment. Tejun, is this
patchable in place or should I send a patch for this?
> a6d1ce5951185ee kernel/cgroup/cgroup.c Yosry Ahmed 2022-10-11 6757 * @fd: fd obtained by open(cgroup_dir)
> 1f3fe7ebf6136c3 kernel/cgroup.c Martin KaFai Lau 2016-06-30 6758 *
> 1f3fe7ebf6136c3 kernel/cgroup.c Martin KaFai Lau 2016-06-30 6759 * Find the cgroup from a fd which should be obtained
> 1f3fe7ebf6136c3 kernel/cgroup.c Martin KaFai Lau 2016-06-30 6760 * by opening a cgroup directory. Returns a pointer to the
> 1f3fe7ebf6136c3 kernel/cgroup.c Martin KaFai Lau 2016-06-30 6761 * cgroup on success. ERR_PTR is returned if the cgroup
> 1f3fe7ebf6136c3 kernel/cgroup.c Martin KaFai Lau 2016-06-30 6762 * cannot be found.
> 1f3fe7ebf6136c3 kernel/cgroup.c Martin KaFai Lau 2016-06-30 6763 */
> a6d1ce5951185ee kernel/cgroup/cgroup.c Yosry Ahmed 2022-10-11 6764 struct cgroup *cgroup_v1v2_get_from_fd(int fd)
> 1f3fe7ebf6136c3 kernel/cgroup.c Martin KaFai Lau 2016-06-30 @6765 {
> 1f3fe7ebf6136c3 kernel/cgroup.c Martin KaFai Lau 2016-06-30 6766 struct cgroup *cgrp;
> 1f3fe7ebf6136c3 kernel/cgroup.c Martin KaFai Lau 2016-06-30 6767 struct file *f;
> 1f3fe7ebf6136c3 kernel/cgroup.c Martin KaFai Lau 2016-06-30 6768
> 1f3fe7ebf6136c3 kernel/cgroup.c Martin KaFai Lau 2016-06-30 6769 f = fget_raw(fd);
> 1f3fe7ebf6136c3 kernel/cgroup.c Martin KaFai Lau 2016-06-30 6770 if (!f)
> 1f3fe7ebf6136c3 kernel/cgroup.c Martin KaFai Lau 2016-06-30 6771 return ERR_PTR(-EBADF);
> 1f3fe7ebf6136c3 kernel/cgroup.c Martin KaFai Lau 2016-06-30 6772
> a6d1ce5951185ee kernel/cgroup/cgroup.c Yosry Ahmed 2022-10-11 6773 cgrp = cgroup_v1v2_get_from_file(f);
> 1f3fe7ebf6136c3 kernel/cgroup.c Martin KaFai Lau 2016-06-30 6774 fput(f);
> 1f3fe7ebf6136c3 kernel/cgroup.c Martin KaFai Lau 2016-06-30 6775 return cgrp;
> 1f3fe7ebf6136c3 kernel/cgroup.c Martin KaFai Lau 2016-06-30 6776 }
> a6d1ce5951185ee kernel/cgroup/cgroup.c Yosry Ahmed 2022-10-11 6777
>
> :::::: The code at line 6765 was first introduced by commit
> :::::: 1f3fe7ebf6136c341012db9f554d4caa566fcbaa cgroup: Add cgroup_get_from_fd
>
> :::::: TO: Martin KaFai Lau <kafai@xxxxxx>
> :::::: CC: David S. Miller <davem@xxxxxxxxxxxxx>
>
> --
> 0-DAY CI Kernel Test Service
> https://01.org/lkp