All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Tiwei Bie <tiwei.btw@antgroup.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Johannes Berg <johannes.berg@intel.com>
Subject: arch/um/drivers/vector_user.c:184:27: sparse: sparse: incorrect type in assignment (different base types)
Date: Thu, 14 May 2026 12:41:09 +0800	[thread overview]
Message-ID: <202605141207.Cy94BJGe-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   e1914add2799225a87502051415fc5c32aeb02ae
commit: b555cb66583e99158cfef8e91c025252cefae55b um: vector: Eliminate the dependency on uml_net
date:   1 year ago
config: um-randconfig-r111-20260514 (https://download.01.org/0day-ci/archive/20260514/202605141207.Cy94BJGe-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 5bac06718f502014fade905512f1d26d578a18f3)
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260514/202605141207.Cy94BJGe-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
| Fixes: b555cb66583e ("um: vector: Eliminate the dependency on uml_net")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605141207.Cy94BJGe-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> arch/um/drivers/vector_user.c:184:27: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be16 [assigned] [usertype] sll_protocol @@     got unsigned short @@
   arch/um/drivers/vector_user.c:184:27: sparse:     expected restricted __be16 [assigned] [usertype] sll_protocol
   arch/um/drivers/vector_user.c:184:27: sparse:     got unsigned short
>> arch/um/drivers/vector_user.c:828:9: sparse: sparse: Using plain integer as NULL pointer
   arch/um/drivers/vector_user.c:908:24: sparse: sparse: Using plain integer as NULL pointer

vim +184 arch/um/drivers/vector_user.c

b3b8ca2a1b63713 Anton Ivanov 2019-08-09  163  
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  164  static int create_raw_fd(char *iface, int flags, int proto)
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  165  {
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  166  	struct ifreq ifr;
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  167  	int fd = -1;
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  168  	struct sockaddr_ll sock;
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  169  	int err = -ENOMEM;
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  170  
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  171  	fd = socket(AF_PACKET, SOCK_RAW, flags);
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  172  	if (fd == -1) {
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  173  		err = -errno;
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  174  		goto raw_fd_cleanup;
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  175  	}
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  176  	memset(&ifr, 0, sizeof(ifr));
1e06589843632af Kees Cook    2024-02-02  177  	strscpy(ifr.ifr_name, iface);
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  178  	if (ioctl(fd, SIOCGIFINDEX, (void *) &ifr) < 0) {
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  179  		err = -errno;
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  180  		goto raw_fd_cleanup;
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  181  	}
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  182  
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  183  	sock.sll_family = AF_PACKET;
b3b8ca2a1b63713 Anton Ivanov 2019-08-09 @184  	sock.sll_protocol = htons(proto);
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  185  	sock.sll_ifindex = ifr.ifr_ifindex;
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  186  
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  187  	if (bind(fd,
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  188  		(struct sockaddr *) &sock, sizeof(struct sockaddr_ll)) < 0) {
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  189  		err = -errno;
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  190  		goto raw_fd_cleanup;
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  191  	}
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  192  	return fd;
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  193  raw_fd_cleanup:
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  194  	printk(UM_KERN_ERR "user_init_raw: init failed, error %d", err);
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  195  	if (fd >= 0)
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  196  		os_close_file(fd);
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  197  	return err;
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  198  }
b3b8ca2a1b63713 Anton Ivanov 2019-08-09  199  

:::::: The code at line 184 was first introduced by commit
:::::: b3b8ca2a1b63713f59e8d7ad772b09bcd8dc9048 um: Add legacy tap support and rename existing vector to hybrid

:::::: TO: Anton Ivanov <anton.ivanov@cambridgegreys.com>
:::::: CC: Richard Weinberger <richard@nod.at>

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

                 reply	other threads:[~2026-05-14  4:41 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=202605141207.Cy94BJGe-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=johannes.berg@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=tiwei.btw@antgroup.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.