All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Chuyi Zhou <zhouchuyi@bytedance.com>
Cc: oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>,
	Alexei Starovoitov <ast@kernel.org>
Subject: [linux-next:master 10527/16121] kernel/bpf/task_iter.c:919:36: error: 'CSS_TASK_ITER_THREADED' undeclared
Date: Tue, 31 Oct 2023 00:23:19 +0800	[thread overview]
Message-ID: <202310310055.RDWloNPr-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   c503e3eec382ac708ee7adf874add37b77c5d312
commit: 9c66dc94b62aef23300f05f63404afb8990920b4 [10527/16121] bpf: Introduce css_task open-coded iterator kfuncs
config: xtensa-randconfig-001-20231030 (https://download.01.org/0day-ci/archive/20231031/202310310055.RDWloNPr-lkp@intel.com/config)
compiler: xtensa-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231031/202310310055.RDWloNPr-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/202310310055.RDWloNPr-lkp@intel.com/

All errors (new ones prefixed by >>):

   kernel/bpf/task_iter.c: In function 'bpf_iter_css_task_new':
   kernel/bpf/task_iter.c:919:14: error: 'CSS_TASK_ITER_PROCS' undeclared (first use in this function)
     919 |         case CSS_TASK_ITER_PROCS | CSS_TASK_ITER_THREADED:
         |              ^~~~~~~~~~~~~~~~~~~
   kernel/bpf/task_iter.c:919:14: note: each undeclared identifier is reported only once for each function it appears in
>> kernel/bpf/task_iter.c:919:36: error: 'CSS_TASK_ITER_THREADED' undeclared (first use in this function)
     919 |         case CSS_TASK_ITER_PROCS | CSS_TASK_ITER_THREADED:
         |                                    ^~~~~~~~~~~~~~~~~~~~~~
>> kernel/bpf/task_iter.c:927:60: error: invalid application of 'sizeof' to incomplete type 'struct css_task_iter'
     927 |         kit->css_it = bpf_mem_alloc(&bpf_global_ma, sizeof(struct css_task_iter));
         |                                                            ^~~~~~
>> kernel/bpf/task_iter.c:930:9: error: implicit declaration of function 'css_task_iter_start'; did you mean 'task_seq_start'? [-Werror=implicit-function-declaration]
     930 |         css_task_iter_start(css, flags, kit->css_it);
         |         ^~~~~~~~~~~~~~~~~~~
         |         task_seq_start
   kernel/bpf/task_iter.c: In function 'bpf_iter_css_task_next':
>> kernel/bpf/task_iter.c:940:16: error: implicit declaration of function 'css_task_iter_next'; did you mean 'class_dev_iter_next'? [-Werror=implicit-function-declaration]
     940 |         return css_task_iter_next(kit->css_it);
         |                ^~~~~~~~~~~~~~~~~~
         |                class_dev_iter_next
   kernel/bpf/task_iter.c:940:16: warning: returning 'int' from a function with return type 'struct task_struct *' makes pointer from integer without a cast [-Wint-conversion]
     940 |         return css_task_iter_next(kit->css_it);
         |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/bpf/task_iter.c: In function 'bpf_iter_css_task_destroy':
>> kernel/bpf/task_iter.c:949:9: error: implicit declaration of function 'css_task_iter_end' [-Werror=implicit-function-declaration]
     949 |         css_task_iter_end(kit->css_it);
         |         ^~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +/CSS_TASK_ITER_THREADED +919 kernel/bpf/task_iter.c

   904	
   905	__diag_push();
   906	__diag_ignore_all("-Wmissing-prototypes",
   907			  "Global functions as their definitions will be in vmlinux BTF");
   908	
   909	__bpf_kfunc int bpf_iter_css_task_new(struct bpf_iter_css_task *it,
   910			struct cgroup_subsys_state *css, unsigned int flags)
   911	{
   912		struct bpf_iter_css_task_kern *kit = (void *)it;
   913	
   914		BUILD_BUG_ON(sizeof(struct bpf_iter_css_task_kern) != sizeof(struct bpf_iter_css_task));
   915		BUILD_BUG_ON(__alignof__(struct bpf_iter_css_task_kern) !=
   916						__alignof__(struct bpf_iter_css_task));
   917		kit->css_it = NULL;
   918		switch (flags) {
 > 919		case CSS_TASK_ITER_PROCS | CSS_TASK_ITER_THREADED:
   920		case CSS_TASK_ITER_PROCS:
   921		case 0:
   922			break;
   923		default:
   924			return -EINVAL;
   925		}
   926	
 > 927		kit->css_it = bpf_mem_alloc(&bpf_global_ma, sizeof(struct css_task_iter));
   928		if (!kit->css_it)
   929			return -ENOMEM;
 > 930		css_task_iter_start(css, flags, kit->css_it);
   931		return 0;
   932	}
   933	
   934	__bpf_kfunc struct task_struct *bpf_iter_css_task_next(struct bpf_iter_css_task *it)
   935	{
   936		struct bpf_iter_css_task_kern *kit = (void *)it;
   937	
   938		if (!kit->css_it)
   939			return NULL;
 > 940		return css_task_iter_next(kit->css_it);
   941	}
   942	
   943	__bpf_kfunc void bpf_iter_css_task_destroy(struct bpf_iter_css_task *it)
   944	{
   945		struct bpf_iter_css_task_kern *kit = (void *)it;
   946	
   947		if (!kit->css_it)
   948			return;
 > 949		css_task_iter_end(kit->css_it);
   950		bpf_mem_free(&bpf_global_ma, kit->css_it);
   951	}
   952	

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

                 reply	other threads:[~2023-10-30 16:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202310310055.RDWloNPr-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=ast@kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=zhouchuyi@bytedance.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.