mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Dmitry Bezrukov <dmitry.bezrukov@aquantia.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Igor Russkikh <igor.russkikh@aquantia.com>
Subject: drivers/net/usb/aqc111.c:623:22: sparse: sparse: incorrect type in assignment (different base types)
Date: Sun, 24 Dec 2023 10:09:01 +0800	[thread overview]
Message-ID: <202312241027.pRt8ik6L-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   3f82f1c3a03694800a4104ca6b6d3282bd4e213d
commit: 4a3576d2bcc755475890e2db717cab0effb1f140 net: usb: aqc111: Implement TX data path
date:   5 years ago
config: x86_64-randconfig-x001-20230717 (https://download.01.org/0day-ci/archive/20231224/202312241027.pRt8ik6L-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231224/202312241027.pRt8ik6L-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/202312241027.pRt8ik6L-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/net/usb/aqc111.c:623:22: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] @@     got restricted __le64 [usertype] @@
   drivers/net/usb/aqc111.c:623:22: sparse:     expected unsigned long long [usertype]
   drivers/net/usb/aqc111.c:623:22: sparse:     got restricted __le64 [usertype]
   drivers/net/usb/aqc111.c: note: in included file (through include/linux/textsearch.h, include/linux/skbuff.h, include/linux/if_ether.h, ...):
   include/linux/slab.h:332:43: sparse: sparse: dubious: x & !y
   drivers/net/usb/aqc111.c:20:12: warning: 'aqc111_read_cmd_nopm' defined but not used [-Wunused-function]
      20 | static int aqc111_read_cmd_nopm(struct usbnet *dev, u8 cmd, u16 value,
         |            ^~~~~~~~~~~~~~~~~~~~

vim +623 drivers/net/usb/aqc111.c

   580	
   581	static struct sk_buff *aqc111_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
   582					       gfp_t flags)
   583	{
   584		int frame_size = dev->maxpacket;
   585		struct sk_buff *new_skb = NULL;
   586		u64 *tx_desc_ptr = NULL;
   587		int padding_size = 0;
   588		int headroom = 0;
   589		int tailroom = 0;
   590		u64 tx_desc = 0;
   591	
   592		/*Length of actual data*/
   593		tx_desc |= skb->len & AQ_TX_DESC_LEN_MASK;
   594	
   595		headroom = (skb->len + sizeof(tx_desc)) % 8;
   596		if (headroom != 0)
   597			padding_size = 8 - headroom;
   598	
   599		if (((skb->len + sizeof(tx_desc) + padding_size) % frame_size) == 0) {
   600			padding_size += 8;
   601			tx_desc |= AQ_TX_DESC_DROP_PADD;
   602		}
   603	
   604		if (!dev->can_dma_sg && (dev->net->features & NETIF_F_SG) &&
   605		    skb_linearize(skb))
   606			return NULL;
   607	
   608		headroom = skb_headroom(skb);
   609		tailroom = skb_tailroom(skb);
   610	
   611		if (!(headroom >= sizeof(tx_desc) && tailroom >= padding_size)) {
   612			new_skb = skb_copy_expand(skb, sizeof(tx_desc),
   613						  padding_size, flags);
   614			dev_kfree_skb_any(skb);
   615			skb = new_skb;
   616			if (!skb)
   617				return NULL;
   618		}
   619		if (padding_size != 0)
   620			skb_put_zero(skb, padding_size);
   621		/* Copy TX header */
   622		tx_desc_ptr = skb_push(skb, sizeof(tx_desc));
 > 623		*tx_desc_ptr = cpu_to_le64(tx_desc);
   624	
   625		usbnet_set_skb_tx_stats(skb, 1, 0);
   626	
   627		return skb;
   628	}
   629	

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

                 reply	other threads:[~2023-12-24  2:09 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=202312241027.pRt8ik6L-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=dmitry.bezrukov@aquantia.com \
    --cc=igor.russkikh@aquantia.com \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®