Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jiri Olsa <jolsa@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [jolsa-perf:trampoline_multi_10 14/21] kernel/bpf/syscall.c:3216:42: error: incompatible pointer types passing 'struct bpf_tramp_node *' to parameter of type 'struct bpf_tramp_link *'
Date: Wed, 23 Oct 2024 17:12:18 +0800	[thread overview]
Message-ID: <202410231731.xZ3KM5Fj-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git trampoline_multi_10
head:   48132820c5a21b82d1a4507a86a67b3742fb110e
commit: 265c1db5da4835a0823af297c907ea7961bd6af0 [14/21] bpf: Rename bpf_tramp_link struct to bpf_tramp_node
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20241023/202410231731.xZ3KM5Fj-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241023/202410231731.xZ3KM5Fj-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/202410231731.xZ3KM5Fj-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

   In file included from kernel/bpf/core.c:21:
   In file included from include/linux/filter.h:9:
>> include/linux/bpf.h:1387:51: warning: declaration of 'struct bpf_tramp_link' will not be visible outside of this function [-Wvisibility]
    1387 | static inline int bpf_trampoline_link_prog(struct bpf_tramp_link *link,
         |                                                   ^
   include/linux/bpf.h:1393:53: warning: declaration of 'struct bpf_tramp_link' will not be visible outside of this function [-Wvisibility]
    1393 | static inline int bpf_trampoline_unlink_prog(struct bpf_tramp_link *link,
         |                                                     ^
   2 warnings generated.
--
   In file included from kernel/bpf/syscall.c:4:
>> include/linux/bpf.h:1387:51: warning: declaration of 'struct bpf_tramp_link' will not be visible outside of this function [-Wvisibility]
    1387 | static inline int bpf_trampoline_link_prog(struct bpf_tramp_link *link,
         |                                                   ^
   include/linux/bpf.h:1393:53: warning: declaration of 'struct bpf_tramp_link' will not be visible outside of this function [-Wvisibility]
    1393 | static inline int bpf_trampoline_unlink_prog(struct bpf_tramp_link *link,
         |                                                     ^
>> kernel/bpf/syscall.c:3216:42: error: incompatible pointer types passing 'struct bpf_tramp_node *' to parameter of type 'struct bpf_tramp_link *' [-Werror,-Wincompatible-pointer-types]
    3216 |         WARN_ON_ONCE(bpf_trampoline_unlink_prog(&tr_link->node,
         |                                                 ^~~~~~~~~~~~~~
   include/asm-generic/bug.h:111:25: note: expanded from macro 'WARN_ON_ONCE'
     111 |         int __ret_warn_on = !!(condition);                      \
         |                                ^~~~~~~~~
   include/linux/bpf.h:1393:69: note: passing argument to parameter 'link' here
    1393 | static inline int bpf_trampoline_unlink_prog(struct bpf_tramp_link *link,
         |                                                                     ^
   kernel/bpf/syscall.c:3432:33: error: incompatible pointer types passing 'struct bpf_tramp_node *' to parameter of type 'struct bpf_tramp_link *' [-Werror,-Wincompatible-pointer-types]
    3432 |         err = bpf_trampoline_link_prog(&link->node, tr, tgt_prog);
         |                                        ^~~~~~~~~~~
   include/linux/bpf.h:1387:67: note: passing argument to parameter 'link' here
    1387 | static inline int bpf_trampoline_link_prog(struct bpf_tramp_link *link,
         |                                                                   ^
   2 warnings and 2 errors generated.


vim +3216 kernel/bpf/syscall.c

  3210	
  3211	static void bpf_tracing_link_release(struct bpf_link *link)
  3212	{
  3213		struct bpf_tracing_link *tr_link =
  3214			container_of(link, struct bpf_tracing_link, link);
  3215	
> 3216		WARN_ON_ONCE(bpf_trampoline_unlink_prog(&tr_link->node,
  3217							tr_link->trampoline,
  3218							tr_link->tgt_prog));
  3219	
  3220		bpf_trampoline_put(tr_link->trampoline);
  3221	
  3222		/* tgt_prog is NULL if target is a kernel function */
  3223		if (tr_link->tgt_prog)
  3224			bpf_prog_put(tr_link->tgt_prog);
  3225	}
  3226	

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

                 reply	other threads:[~2024-10-23  9:12 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=202410231731.xZ3KM5Fj-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=jolsa@kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox