lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202307271907.kj7vV86A-lkp@intel.com>
Date:   Thu, 27 Jul 2023 19:13:36 +0800
From:   kernel test robot <lkp@...el.com>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: drivers/net/wireless/ath/ath6kl/htc_pipe.c:241:17: sparse: sparse:
 incorrect type in assignment (different base types)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   0a8db05b571ad5b8d5c8774a004c0424260a90bd
commit: 803f4e1eab7a8938ba3a3c30dd4eb5e9eeef5e63 asm-generic: simplify asm/unaligned.h
date:   2 years, 2 months ago
config: i386-randconfig-i062-20230727 (https://download.01.org/0day-ci/archive/20230727/202307271907.kj7vV86A-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230727/202307271907.kj7vV86A-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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202307271907.kj7vV86A-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/net/wireless/ath/ath6kl/htc_pipe.c:241:17: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le16 x @@     got unsigned short [usertype] @@
   drivers/net/wireless/ath/ath6kl/htc_pipe.c:241:17: sparse:     expected restricted __le16 x
   drivers/net/wireless/ath/ath6kl/htc_pipe.c:241:17: sparse:     got unsigned short [usertype]
--
>> drivers/net/wireless/ath/ath6kl/htc_mbox.c:368:9: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le16 x @@     got unsigned short [usertype] @@
   drivers/net/wireless/ath/ath6kl/htc_mbox.c:368:9: sparse:     expected restricted __le16 x
   drivers/net/wireless/ath/ath6kl/htc_mbox.c:368:9: sparse:     got unsigned short [usertype]

vim +241 drivers/net/wireless/ath/ath6kl/htc_pipe.c

636f828844fad9 Kalle Valo    2012-03-25  202  
636f828844fad9 Kalle Valo    2012-03-25  203  static int htc_issue_packets(struct htc_target *target,
636f828844fad9 Kalle Valo    2012-03-25  204  			     struct htc_endpoint *ep,
636f828844fad9 Kalle Valo    2012-03-25  205  			     struct list_head *pkt_queue)
636f828844fad9 Kalle Valo    2012-03-25  206  {
636f828844fad9 Kalle Valo    2012-03-25  207  	int status = 0;
636f828844fad9 Kalle Valo    2012-03-25  208  	u16 payload_len;
636f828844fad9 Kalle Valo    2012-03-25  209  	struct sk_buff *skb;
636f828844fad9 Kalle Valo    2012-03-25  210  	struct htc_frame_hdr *htc_hdr;
636f828844fad9 Kalle Valo    2012-03-25  211  	struct htc_packet *packet;
636f828844fad9 Kalle Valo    2012-03-25  212  
636f828844fad9 Kalle Valo    2012-03-25  213  	ath6kl_dbg(ATH6KL_DBG_HTC,
636f828844fad9 Kalle Valo    2012-03-25  214  		   "%s: queue: 0x%p, pkts %d\n", __func__,
636f828844fad9 Kalle Valo    2012-03-25  215  		   pkt_queue, get_queue_depth(pkt_queue));
636f828844fad9 Kalle Valo    2012-03-25  216  
636f828844fad9 Kalle Valo    2012-03-25  217  	while (!list_empty(pkt_queue)) {
636f828844fad9 Kalle Valo    2012-03-25  218  		packet = list_first_entry(pkt_queue, struct htc_packet, list);
636f828844fad9 Kalle Valo    2012-03-25  219  		list_del(&packet->list);
636f828844fad9 Kalle Valo    2012-03-25  220  
636f828844fad9 Kalle Valo    2012-03-25  221  		skb = packet->skb;
636f828844fad9 Kalle Valo    2012-03-25  222  		if (!skb) {
636f828844fad9 Kalle Valo    2012-03-25  223  			WARN_ON_ONCE(1);
636f828844fad9 Kalle Valo    2012-03-25  224  			status = -EINVAL;
636f828844fad9 Kalle Valo    2012-03-25  225  			break;
636f828844fad9 Kalle Valo    2012-03-25  226  		}
636f828844fad9 Kalle Valo    2012-03-25  227  
636f828844fad9 Kalle Valo    2012-03-25  228  		payload_len = packet->act_len;
636f828844fad9 Kalle Valo    2012-03-25  229  
636f828844fad9 Kalle Valo    2012-03-25  230  		/* setup HTC frame header */
d58ff35122847a Johannes Berg 2017-06-16  231  		htc_hdr = skb_push(skb, sizeof(*htc_hdr));
636f828844fad9 Kalle Valo    2012-03-25  232  		if (!htc_hdr) {
636f828844fad9 Kalle Valo    2012-03-25  233  			WARN_ON_ONCE(1);
636f828844fad9 Kalle Valo    2012-03-25  234  			status = -EINVAL;
636f828844fad9 Kalle Valo    2012-03-25  235  			break;
636f828844fad9 Kalle Valo    2012-03-25  236  		}
636f828844fad9 Kalle Valo    2012-03-25  237  
636f828844fad9 Kalle Valo    2012-03-25  238  		packet->info.tx.flags |= HTC_FLAGS_TX_FIXUP_NETBUF;
636f828844fad9 Kalle Valo    2012-03-25  239  
636f828844fad9 Kalle Valo    2012-03-25  240  		/* Endianess? */
636f828844fad9 Kalle Valo    2012-03-25 @241  		put_unaligned((u16) payload_len, &htc_hdr->payld_len);
636f828844fad9 Kalle Valo    2012-03-25  242  		htc_hdr->flags = packet->info.tx.flags;
636f828844fad9 Kalle Valo    2012-03-25  243  		htc_hdr->eid = (u8) packet->endpoint;
636f828844fad9 Kalle Valo    2012-03-25  244  		htc_hdr->ctrl[0] = 0;
636f828844fad9 Kalle Valo    2012-03-25  245  		htc_hdr->ctrl[1] = (u8) packet->info.tx.seqno;
636f828844fad9 Kalle Valo    2012-03-25  246  
636f828844fad9 Kalle Valo    2012-03-25  247  		spin_lock_bh(&target->tx_lock);
636f828844fad9 Kalle Valo    2012-03-25  248  
636f828844fad9 Kalle Valo    2012-03-25  249  		/* store in look up queue to match completions */
636f828844fad9 Kalle Valo    2012-03-25  250  		list_add_tail(&packet->list, &ep->pipe.tx_lookup_queue);
636f828844fad9 Kalle Valo    2012-03-25  251  		ep->ep_st.tx_issued += 1;
636f828844fad9 Kalle Valo    2012-03-25  252  		spin_unlock_bh(&target->tx_lock);
636f828844fad9 Kalle Valo    2012-03-25  253  
636f828844fad9 Kalle Valo    2012-03-25  254  		status = ath6kl_hif_pipe_send(target->dev->ar,
636f828844fad9 Kalle Valo    2012-03-25  255  					      ep->pipe.pipeid_ul, NULL, skb);
636f828844fad9 Kalle Valo    2012-03-25  256  
636f828844fad9 Kalle Valo    2012-03-25  257  		if (status != 0) {
636f828844fad9 Kalle Valo    2012-03-25  258  			if (status != -ENOMEM) {
636f828844fad9 Kalle Valo    2012-03-25  259  				/* TODO: if more than 1 endpoint maps to the
636f828844fad9 Kalle Valo    2012-03-25  260  				 * same PipeID, it is possible to run out of
636f828844fad9 Kalle Valo    2012-03-25  261  				 * resources in the HIF layer.
636f828844fad9 Kalle Valo    2012-03-25  262  				 * Don't emit the error
636f828844fad9 Kalle Valo    2012-03-25  263  				 */
636f828844fad9 Kalle Valo    2012-03-25  264  				ath6kl_dbg(ATH6KL_DBG_HTC,
636f828844fad9 Kalle Valo    2012-03-25  265  					   "%s: failed status:%d\n",
636f828844fad9 Kalle Valo    2012-03-25  266  					   __func__, status);
636f828844fad9 Kalle Valo    2012-03-25  267  			}
636f828844fad9 Kalle Valo    2012-03-25  268  			spin_lock_bh(&target->tx_lock);
636f828844fad9 Kalle Valo    2012-03-25  269  			list_del(&packet->list);
636f828844fad9 Kalle Valo    2012-03-25  270  
636f828844fad9 Kalle Valo    2012-03-25  271  			/* reclaim credits */
636f828844fad9 Kalle Valo    2012-03-25  272  			ep->cred_dist.credits += packet->info.tx.cred_used;
636f828844fad9 Kalle Valo    2012-03-25  273  			spin_unlock_bh(&target->tx_lock);
636f828844fad9 Kalle Valo    2012-03-25  274  
636f828844fad9 Kalle Valo    2012-03-25  275  			/* put it back into the callers queue */
636f828844fad9 Kalle Valo    2012-03-25  276  			list_add(&packet->list, pkt_queue);
636f828844fad9 Kalle Valo    2012-03-25  277  			break;
636f828844fad9 Kalle Valo    2012-03-25  278  		}
636f828844fad9 Kalle Valo    2012-03-25  279  	}
636f828844fad9 Kalle Valo    2012-03-25  280  
636f828844fad9 Kalle Valo    2012-03-25  281  	if (status != 0) {
636f828844fad9 Kalle Valo    2012-03-25  282  		while (!list_empty(pkt_queue)) {
636f828844fad9 Kalle Valo    2012-03-25  283  			if (status != -ENOMEM) {
636f828844fad9 Kalle Valo    2012-03-25  284  				ath6kl_dbg(ATH6KL_DBG_HTC,
636f828844fad9 Kalle Valo    2012-03-25  285  					   "%s: failed pkt:0x%p status:%d\n",
636f828844fad9 Kalle Valo    2012-03-25  286  					   __func__, packet, status);
636f828844fad9 Kalle Valo    2012-03-25  287  			}
636f828844fad9 Kalle Valo    2012-03-25  288  
636f828844fad9 Kalle Valo    2012-03-25  289  			packet = list_first_entry(pkt_queue,
636f828844fad9 Kalle Valo    2012-03-25  290  						  struct htc_packet, list);
636f828844fad9 Kalle Valo    2012-03-25  291  			list_del(&packet->list);
636f828844fad9 Kalle Valo    2012-03-25  292  			packet->status = status;
636f828844fad9 Kalle Valo    2012-03-25  293  			send_packet_completion(target, packet);
636f828844fad9 Kalle Valo    2012-03-25  294  		}
636f828844fad9 Kalle Valo    2012-03-25  295  	}
636f828844fad9 Kalle Valo    2012-03-25  296  
636f828844fad9 Kalle Valo    2012-03-25  297  	return status;
636f828844fad9 Kalle Valo    2012-03-25  298  }
636f828844fad9 Kalle Valo    2012-03-25  299  

:::::: The code at line 241 was first introduced by commit
:::::: 636f828844fad9421ea6e7df053bba995febdecf ath6kl: Add HTC pipe implementation

:::::: TO: Kalle Valo <kvalo@....qualcomm.com>
:::::: CC: Kalle Valo <kvalo@....qualcomm.com>

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ