All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Hannes Reinecke <hare@suse.de>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [hare-scsi-devel:configfs-ns.v6 26/26] drivers/nvme/target/bpf_ops.c:104:59: sparse: sparse: Using plain integer as NULL pointer
Date: Tue, 23 Jun 2026 13:01:55 +0800	[thread overview]
Message-ID: <202606231257.AlAit6EU-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git configfs-ns.v6
head:   22642e5d1c63efa6b484188105d45886f637d2be
commit: 22642e5d1c63efa6b484188105d45886f637d2be [26/26] Switch to net namespaces
config: riscv-randconfig-r121-20260623 (https://download.01.org/0day-ci/archive/20260623/202606231257.AlAit6EU-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 8.5.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260623/202606231257.AlAit6EU-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/202606231257.AlAit6EU-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/nvme/target/bpf_ops.c:104:59: sparse: sparse: Using plain integer as NULL pointer
   drivers/nvme/target/bpf_ops.c:110:33: sparse: sparse: restricted __le16 degrades to integer

vim +104 drivers/nvme/target/bpf_ops.c

95eeb6714114cd Hannes Reinecke 2025-07-28   97  
95eeb6714114cd Hannes Reinecke 2025-07-28   98  static int nvmet_bpf_reg(void *kdata, struct bpf_link *link)
95eeb6714114cd Hannes Reinecke 2025-07-28   99  {
95eeb6714114cd Hannes Reinecke 2025-07-28  100  	struct nvmet_bpf_ops *ops = kdata;
95eeb6714114cd Hannes Reinecke 2025-07-28  101  	struct nvmet_port *p, *port = NULL;
95eeb6714114cd Hannes Reinecke 2025-07-28  102  	struct nvmet_subsys_link *s;
65843faa046b6a Hannes Reinecke 2026-06-12  103  	/* This is wrong :-( */
65843faa046b6a Hannes Reinecke 2026-06-12 @104  	struct list_head *port_list = nvmet_get_port_list(0);
95eeb6714114cd Hannes Reinecke 2025-07-28  105  
95eeb6714114cd Hannes Reinecke 2025-07-28  106  	pr_debug("%s: register %s port id %d\n",
95eeb6714114cd Hannes Reinecke 2025-07-28  107  		 __func__, ops->subsysnqn, ops->portid);
95eeb6714114cd Hannes Reinecke 2025-07-28  108  
65843faa046b6a Hannes Reinecke 2026-06-12  109  	list_for_each_entry(p, port_list, global_entry) {
95eeb6714114cd Hannes Reinecke 2025-07-28  110  		if (p->disc_addr.portid == ops->portid) {
95eeb6714114cd Hannes Reinecke 2025-07-28  111  			port = p;
95eeb6714114cd Hannes Reinecke 2025-07-28  112  			break;
95eeb6714114cd Hannes Reinecke 2025-07-28  113  		}
95eeb6714114cd Hannes Reinecke 2025-07-28  114  	}
95eeb6714114cd Hannes Reinecke 2025-07-28  115  	if (!port)
95eeb6714114cd Hannes Reinecke 2025-07-28  116  		return -EINVAL;
95eeb6714114cd Hannes Reinecke 2025-07-28  117  
95eeb6714114cd Hannes Reinecke 2025-07-28  118  	down_write(&nvmet_config_sem);
95eeb6714114cd Hannes Reinecke 2025-07-28  119  	list_for_each_entry(s, &port->subsystems, entry) {
95eeb6714114cd Hannes Reinecke 2025-07-28  120  		if (!strncmp(s->subsys->subsysnqn, ops->subsysnqn,
95eeb6714114cd Hannes Reinecke 2025-07-28  121  			     NVMF_NQN_SIZE)) {
95eeb6714114cd Hannes Reinecke 2025-07-28  122  			s->bpf_ops = ops;
95eeb6714114cd Hannes Reinecke 2025-07-28  123  			ops->subsys_link = s;
95eeb6714114cd Hannes Reinecke 2025-07-28  124  			break;
95eeb6714114cd Hannes Reinecke 2025-07-28  125  		}
95eeb6714114cd Hannes Reinecke 2025-07-28  126  	}
95eeb6714114cd Hannes Reinecke 2025-07-28  127  	up_write(&nvmet_config_sem);
95eeb6714114cd Hannes Reinecke 2025-07-28  128  	if (ops->subsys_link) {
95eeb6714114cd Hannes Reinecke 2025-07-28  129  		pr_debug("%s: attached %pUb to %s\n",
95eeb6714114cd Hannes Reinecke 2025-07-28  130  			 __func__, &ops->uuid,
95eeb6714114cd Hannes Reinecke 2025-07-28  131  			 ops->subsys_link->subsys->serial);
95eeb6714114cd Hannes Reinecke 2025-07-28  132  		/* Raise a discovery log page changed AEN if log page is present */
95eeb6714114cd Hannes Reinecke 2025-07-28  133  		if (ops->log_page_supported(ops, NVME_LOG_DISC))
95eeb6714114cd Hannes Reinecke 2025-07-28  134  			nvmet_port_disc_changed(port, ops->subsys_link->subsys);
95eeb6714114cd Hannes Reinecke 2025-07-28  135  	}
95eeb6714114cd Hannes Reinecke 2025-07-28  136  	return ops->subsys_link ? 0 : -EINVAL;
95eeb6714114cd Hannes Reinecke 2025-07-28  137  }
95eeb6714114cd Hannes Reinecke 2025-07-28  138  

:::::: The code at line 104 was first introduced by commit
:::::: 65843faa046b6a3ff4953aba7319313104638535 nvmet: make configfs setup namespace aware

:::::: TO: Hannes Reinecke <hare@kernel.org>
:::::: CC: Hannes Reinecke <hare@kernel.org>

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

                 reply	other threads:[~2026-06-23  5:02 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=202606231257.AlAit6EU-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=hare@suse.de \
    --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 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.