linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [iwlwifi-next:iwlmei 2/6] drivers/net/wireless/intel/iwlwifi/mei/main.c:972:5: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'ssize_t' {aka 'int'}
@ 2021-07-15 13:08 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-07-15 13:08 UTC (permalink / raw)
  To: Emmanuel Grumbach; +Cc: kbuild-all, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 6509 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.git iwlmei
head:   aad614fbd0f4eee40f731cff93b5366b1f3153f3
commit: 056acc96d6063163ecad5fc458caa92afd647512 [2/6] iwlwifi: mei: add the driver to allow cooperation with CSME
config: i386-allyesconfig (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.git/commit/?id=056acc96d6063163ecad5fc458caa92afd647512
        git remote add iwlwifi-next https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.git
        git fetch --no-tags iwlwifi-next iwlmei
        git checkout 056acc96d6063163ecad5fc458caa92afd647512
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

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 include/linux/device.h:15,
                    from include/linux/dma-mapping.h:7,
                    from include/linux/skbuff.h:31,
                    from include/linux/if_ether.h:19,
                    from include/linux/etherdevice.h:20,
                    from drivers/net/wireless/intel/iwlwifi/mei/main.c:6:
   drivers/net/wireless/intel/iwlwifi/mei/main.c: In function 'iwl_mei_handle_sap_data':
>> drivers/net/wireless/intel/iwlwifi/mei/main.c:972:5: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'ssize_t' {aka 'int'} [-Wformat=]
     972 |     "Data queue is corrupted: valid data len %ld, len %d\n",
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
      19 | #define dev_fmt(fmt) fmt
         |                      ^~~
   drivers/net/wireless/intel/iwlwifi/mei/main.c:971:4: note: in expansion of macro 'dev_err'
     971 |    dev_err(&cldev->dev,
         |    ^~~~~~~
   drivers/net/wireless/intel/iwlwifi/mei/main.c:972:48: note: format string is defined here
     972 |     "Data queue is corrupted: valid data len %ld, len %d\n",
         |                                              ~~^
         |                                                |
         |                                                long int
         |                                              %d
   In file included from include/linux/device.h:15,
                    from include/linux/dma-mapping.h:7,
                    from include/linux/skbuff.h:31,
                    from include/linux/if_ether.h:19,
                    from include/linux/etherdevice.h:20,
                    from drivers/net/wireless/intel/iwlwifi/mei/main.c:6:
   drivers/net/wireless/intel/iwlwifi/mei/main.c: In function 'iwl_mei_rx':
   drivers/net/wireless/intel/iwlwifi/mei/main.c:1160:24: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'ssize_t' {aka 'int'} [-Wformat=]
    1160 |   dev_err(&cldev->dev, "failed to receive data: %ld\n", ret);
         |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
      19 | #define dev_fmt(fmt) fmt
         |                      ^~~
   drivers/net/wireless/intel/iwlwifi/mei/main.c:1160:3: note: in expansion of macro 'dev_err'
    1160 |   dev_err(&cldev->dev, "failed to receive data: %ld\n", ret);
         |   ^~~~~~~
   drivers/net/wireless/intel/iwlwifi/mei/main.c:1160:51: note: format string is defined here
    1160 |   dev_err(&cldev->dev, "failed to receive data: %ld\n", ret);
         |                                                 ~~^
         |                                                   |
         |                                                   long int
         |                                                 %d


vim +972 drivers/net/wireless/intel/iwlwifi/mei/main.c

   946	
   947	static void iwl_mei_handle_sap_data(struct mei_cl_device *cldev,
   948					    const u8 *q_head, u32 q_sz,
   949					    u32 rd, u32 wr, ssize_t valid_rx_sz,
   950					    struct sk_buff_head *tx_skbs)
   951	{
   952		struct iwl_sap_hdr hdr;
   953		struct net_device *netdev =
   954			rcu_dereference_protected(iwl_mei_cache.netdev,
   955						  lockdep_is_held(&iwl_mei_mutex));
   956	
   957		if (!netdev)
   958			return;
   959	
   960		while (valid_rx_sz >= sizeof(hdr)) {
   961			struct ethhdr *ethhdr;
   962			unsigned char *data;
   963			struct sk_buff *skb;
   964			u16 len;
   965	
   966			iwl_mei_read_from_q(q_head, q_sz, &rd, wr, &hdr, sizeof(hdr));
   967			valid_rx_sz -= sizeof(hdr);
   968			len = le16_to_cpu(hdr.len);
   969	
   970			if (valid_rx_sz < len) {
   971				dev_err(&cldev->dev,
 > 972					"Data queue is corrupted: valid data len %ld, len %d\n",
   973					valid_rx_sz, len);
   974				break;
   975			}
   976	
   977			if (len < sizeof(*ethhdr)) {
   978				dev_err(&cldev->dev,
   979					"Data len is smaller than an ethernet header? len = %d\n",
   980					len);
   981			}
   982	
   983			valid_rx_sz -= len;
   984	
   985			if (le16_to_cpu(hdr.type) != SAP_MSG_DATA_PACKET) {
   986				dev_err(&cldev->dev, "Unsupported Rx data: type %d, len %d\n",
   987					le16_to_cpu(hdr.type), len);
   988				continue;
   989			}
   990	
   991			/* We need enough room for the WiFi header + SNAP + IV */
   992			skb = netdev_alloc_skb(netdev, len + 26 + 8 + 8);
   993	
   994			skb_reserve(skb, 26 + 8 + 8);
   995			ethhdr = skb_push(skb, sizeof(*ethhdr));
   996	
   997			iwl_mei_read_from_q(q_head, q_sz, &rd, wr,
   998					    ethhdr, sizeof(*ethhdr));
   999			len -= sizeof(*ethhdr);
  1000	
  1001			skb_reset_mac_header(skb);
  1002			skb_reset_network_header(skb);
  1003			skb->protocol = ethhdr->h_proto;
  1004	
  1005			data = skb_put(skb, len);
  1006			iwl_mei_read_from_q(q_head, q_sz, &rd, wr, data, len);
  1007	
  1008			/*
  1009			 * Enqueue the skb here so that it can be sent later when we
  1010			 * do not hold the mutex. TX'ing a packet with a mutex held is
  1011			 * possible, but it wouldn't be nice to forbid the TX path to
  1012			 * call any of iwlmei's functions, since every API from iwlmei
  1013			 * needs the mutex.
  1014			 */
  1015			__skb_queue_tail(tx_skbs, skb);
  1016		}
  1017	}
  1018	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 64779 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-15 13:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15 13:08 [iwlwifi-next:iwlmei 2/6] drivers/net/wireless/intel/iwlwifi/mei/main.c:972:5: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'ssize_t' {aka 'int'} kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).