mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org
Subject: [mingo-tip:sched/headers 1662/2356] include/linux/bpf-cgroup-api.h:99:17: warning: incompatible integer to pointer conversion initializing 'struct cgroup *' with an expression of type 'int'
Date: Tue, 19 Apr 2022 11:26:06 +0800	[thread overview]
Message-ID: <202204191109.jMo5t4hA-lkp@intel.com> (raw)

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git sched/headers
head:   af93551cf39027d176f30b9beafc60a4c130998a
commit: 946f6b0a519a1210d974a40c8400726c341e0bd6 [1662/2356] headers/deps: cgroup: Split <linux/bpf-cgroup.h> into <linux/bpf-cgroup-types.h> and <linux/bpf-cgroup-api.h>
config: x86_64-randconfig-a013-20220418 (https://download.01.org/0day-ci/archive/20220419/202204191109.jMo5t4hA-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 429cbac0390654f90bba18a41799464adf31a5ec)
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://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git/commit/?id=946f6b0a519a1210d974a40c8400726c341e0bd6
        git remote add mingo-tip git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git
        git fetch --no-tags mingo-tip sched/headers
        git checkout 946f6b0a519a1210d974a40c8400726c341e0bd6
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash kernel/bpf/ mm/ net/ipv4/ sound/soc/codecs/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from kernel/bpf/cgroup.c:17:
   include/linux/bpf-cgroup-api.h:99:24: error: implicit declaration of function 'sock_cgroup_ptr' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
           struct cgroup *cgrp = sock_cgroup_ptr(&sk->sk_cgrp_data);
                                 ^
>> include/linux/bpf-cgroup-api.h:99:17: warning: incompatible integer to pointer conversion initializing 'struct cgroup *' with an expression of type 'int' [-Wint-conversion]
           struct cgroup *cgrp = sock_cgroup_ptr(&sk->sk_cgrp_data);
                          ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from kernel/bpf/cgroup.c:31:
   In file included from kernel/bpf/../cgroup/cgroup-internal.h:7:
   include/linux/cgroup_api.h:875:30: error: static declaration of 'sock_cgroup_ptr' follows non-static declaration
   static inline struct cgroup *sock_cgroup_ptr(struct sock_cgroup_data *skcd)
                                ^
   include/linux/bpf-cgroup-api.h:99:24: note: previous implicit declaration is here
           struct cgroup *cgrp = sock_cgroup_ptr(&sk->sk_cgrp_data);
                                 ^
   1 warning and 2 errors generated.
--
   In file included from net/ipv4/udp.c:103:
   include/linux/bpf-cgroup-api.h:99:24: error: implicit declaration of function 'sock_cgroup_ptr' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
           struct cgroup *cgrp = sock_cgroup_ptr(&sk->sk_cgrp_data);
                                 ^
>> include/linux/bpf-cgroup-api.h:99:17: warning: incompatible integer to pointer conversion initializing 'struct cgroup *' with an expression of type 'int' [-Wint-conversion]
           struct cgroup *cgrp = sock_cgroup_ptr(&sk->sk_cgrp_data);
                          ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning and 1 error generated.


vim +99 include/linux/bpf-cgroup-api.h

    90	
    91	int bpf_percpu_cgroup_storage_copy(struct bpf_map *map, void *key, void *value);
    92	int bpf_percpu_cgroup_storage_update(struct bpf_map *map, void *key,
    93					     void *value, u64 flags);
    94	
    95	/* Opportunistic check to see whether we have any BPF program attached*/
    96	static inline bool cgroup_bpf_sock_enabled(struct sock *sk,
    97						   enum cgroup_bpf_attach_type type)
    98	{
  > 99		struct cgroup *cgrp = sock_cgroup_ptr(&sk->sk_cgrp_data);
   100		struct bpf_prog_array *array;
   101	
   102		array = rcu_access_pointer(cgrp->bpf.effective[type]);
   103		return array != &bpf_empty_prog_array.hdr;
   104	}
   105	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

                 reply	other threads:[~2022-04-19  3:26 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=202204191109.jMo5t4hA-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=mingo@kernel.org \
    /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

all inboxes | Powered by JetHome®