From: kernel test robot <lkp@intel.com>
To: Shannon Nelson <snelson@pensando.io>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
Jakub Kicinski <kuba@kernel.org>
Subject: drivers/net/ethernet/pensando/ionic/ionic_txrx.c:100:28: sparse: sparse: cast truncates bits from constant value (10000 becomes 0)
Date: Tue, 1 Dec 2020 13:19:01 +0800 [thread overview]
Message-ID: <202012011357.iz7Q03V2-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 5663 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: b65054597872ce3aefbc6a666385eabdf9e288da
commit: d701ec326a31945d1533b438a6feab753829b738 ionic: clean up sparse complaints
date: 5 weeks ago
config: ia64-randconfig-s032-20201201 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-170-g3bc348f6-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d701ec326a31945d1533b438a6feab753829b738
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout d701ec326a31945d1533b438a6feab753829b738
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=ia64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
"sparse warnings: (new ones prefixed by >>)"
>> drivers/net/ethernet/pensando/ionic/ionic_txrx.c:100:28: sparse: sparse: cast truncates bits from constant value (10000 becomes 0)
drivers/net/ethernet/pensando/ionic/ionic_txrx.c: note: in included file (through arch/ia64/include/asm/io.h, arch/ia64/include/asm/uaccess.h, include/linux/uaccess.h, ...):
include/asm-generic/io.h:236:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned long long [usertype] value @@ got restricted __le64 [usertype] @@
include/asm-generic/io.h:236:22: sparse: expected unsigned long long [usertype] value
include/asm-generic/io.h:236:22: sparse: got restricted __le64 [usertype]
vim +100 drivers/net/ethernet/pensando/ionic/ionic_txrx.c
0f3154e6bcb3549 Shannon Nelson 2019-09-03 68
08f2e4b2b2008ce Shannon Nelson 2019-10-23 69 static struct sk_buff *ionic_rx_frags(struct ionic_queue *q,
08f2e4b2b2008ce Shannon Nelson 2019-10-23 70 struct ionic_desc_info *desc_info,
08f2e4b2b2008ce Shannon Nelson 2019-10-23 71 struct ionic_cq_info *cq_info)
0f3154e6bcb3549 Shannon Nelson 2019-09-03 72 {
0f3154e6bcb3549 Shannon Nelson 2019-09-03 73 struct ionic_rxq_comp *comp = cq_info->cq_desc;
0f3154e6bcb3549 Shannon Nelson 2019-09-03 74 struct device *dev = q->lif->ionic->dev;
08f2e4b2b2008ce Shannon Nelson 2019-10-23 75 struct ionic_page_info *page_info;
08f2e4b2b2008ce Shannon Nelson 2019-10-23 76 struct sk_buff *skb;
08f2e4b2b2008ce Shannon Nelson 2019-10-23 77 unsigned int i;
08f2e4b2b2008ce Shannon Nelson 2019-10-23 78 u16 frag_len;
08f2e4b2b2008ce Shannon Nelson 2019-10-23 79 u16 len;
08f2e4b2b2008ce Shannon Nelson 2019-10-23 80
08f2e4b2b2008ce Shannon Nelson 2019-10-23 81 page_info = &desc_info->pages[0];
08f2e4b2b2008ce Shannon Nelson 2019-10-23 82 len = le16_to_cpu(comp->len);
08f2e4b2b2008ce Shannon Nelson 2019-10-23 83
08f2e4b2b2008ce Shannon Nelson 2019-10-23 84 prefetch(page_address(page_info->page) + NET_IP_ALIGN);
08f2e4b2b2008ce Shannon Nelson 2019-10-23 85
08f2e4b2b2008ce Shannon Nelson 2019-10-23 86 skb = ionic_rx_skb_alloc(q, len, true);
08f2e4b2b2008ce Shannon Nelson 2019-10-23 87 if (unlikely(!skb))
08f2e4b2b2008ce Shannon Nelson 2019-10-23 88 return NULL;
08f2e4b2b2008ce Shannon Nelson 2019-10-23 89
08f2e4b2b2008ce Shannon Nelson 2019-10-23 90 i = comp->num_sg_elems + 1;
08f2e4b2b2008ce Shannon Nelson 2019-10-23 91 do {
08f2e4b2b2008ce Shannon Nelson 2019-10-23 92 if (unlikely(!page_info->page)) {
08f2e4b2b2008ce Shannon Nelson 2019-10-23 93 struct napi_struct *napi = &q_to_qcq(q)->napi;
08f2e4b2b2008ce Shannon Nelson 2019-10-23 94
08f2e4b2b2008ce Shannon Nelson 2019-10-23 95 napi->skb = NULL;
08f2e4b2b2008ce Shannon Nelson 2019-10-23 96 dev_kfree_skb(skb);
08f2e4b2b2008ce Shannon Nelson 2019-10-23 97 return NULL;
0f3154e6bcb3549 Shannon Nelson 2019-09-03 98 }
0f3154e6bcb3549 Shannon Nelson 2019-09-03 99
08f2e4b2b2008ce Shannon Nelson 2019-10-23 @100 frag_len = min(len, (u16)PAGE_SIZE);
08f2e4b2b2008ce Shannon Nelson 2019-10-23 101 len -= frag_len;
08f2e4b2b2008ce Shannon Nelson 2019-10-23 102
08f2e4b2b2008ce Shannon Nelson 2019-10-23 103 dma_unmap_page(dev, dma_unmap_addr(page_info, dma_addr),
08f2e4b2b2008ce Shannon Nelson 2019-10-23 104 PAGE_SIZE, DMA_FROM_DEVICE);
08f2e4b2b2008ce Shannon Nelson 2019-10-23 105 skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
08f2e4b2b2008ce Shannon Nelson 2019-10-23 106 page_info->page, 0, frag_len, PAGE_SIZE);
08f2e4b2b2008ce Shannon Nelson 2019-10-23 107 page_info->page = NULL;
08f2e4b2b2008ce Shannon Nelson 2019-10-23 108 page_info++;
08f2e4b2b2008ce Shannon Nelson 2019-10-23 109 i--;
08f2e4b2b2008ce Shannon Nelson 2019-10-23 110 } while (i > 0);
08f2e4b2b2008ce Shannon Nelson 2019-10-23 111
08f2e4b2b2008ce Shannon Nelson 2019-10-23 112 return skb;
0f3154e6bcb3549 Shannon Nelson 2019-09-03 113 }
0f3154e6bcb3549 Shannon Nelson 2019-09-03 114
:::::: The code at line 100 was first introduced by commit
:::::: 08f2e4b2b2008ce461dd6958caa616a2e3a30ac8 ionic: implement support for rx sgl
:::::: TO: Shannon Nelson <snelson@pensando.io>
:::::: CC: David S. Miller <davem@davemloft.net>
---
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: 30938 bytes --]
reply other threads:[~2020-12-01 5:20 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=202012011357.iz7Q03V2-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=snelson@pensando.io \
/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®