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]
Date:   Thu, 21 Jun 2018 11:43:54 +0800
From:   kbuild test robot <lkp@...el.com>
To:     Antoine Tenart <antoine.tenart@...tlin.com>
Cc:     kbuild-all@...org, netdev@...r.kernel.org,
        Alexandre Belloni <alexandre.belloni@...tlin.com>
Subject: [net:master 6/6] drivers/net/ethernet/mscc/ocelot.c:377:17: sparse:
 incorrect type in argument 2 (different base types)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git master
head:   08d02364b12faa54d76dbfea2090321fd27996f2
commit: 08d02364b12faa54d76dbfea2090321fd27996f2 [6/6] net: mscc: fix the injection header
reproduce:
        # apt-get install sparse
        git checkout 08d02364b12faa54d76dbfea2090321fd27996f2
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

>> drivers/net/ethernet/mscc/ocelot.c:377:17: sparse: incorrect type in argument 2 (different base types) @@    expected unsigned int [unsigned] [usertype] val @@    got ed int [unsigned] [usertype] val @@
   drivers/net/ethernet/mscc/ocelot.c:377:17:    expected unsigned int [unsigned] [usertype] val
   drivers/net/ethernet/mscc/ocelot.c:377:17:    got restricted __be32 [usertype] <noident>
   include/linux/device.h:678:13: sparse: undefined identifier '__builtin_mul_overflow'
   include/linux/device.h:678:13: sparse: call with no type!

vim +377 drivers/net/ethernet/mscc/ocelot.c

   353	
   354	static int ocelot_port_xmit(struct sk_buff *skb, struct net_device *dev)
   355	{
   356		struct ocelot_port *port = netdev_priv(dev);
   357		struct ocelot *ocelot = port->ocelot;
   358		u32 val, ifh[IFH_LEN];
   359		struct frame_info info = {};
   360		u8 grp = 0; /* Send everything on CPU group 0 */
   361		unsigned int i, count, last;
   362	
   363		val = ocelot_read(ocelot, QS_INJ_STATUS);
   364		if (!(val & QS_INJ_STATUS_FIFO_RDY(BIT(grp))) ||
   365		    (val & QS_INJ_STATUS_WMARK_REACHED(BIT(grp))))
   366			return NETDEV_TX_BUSY;
   367	
   368		ocelot_write_rix(ocelot, QS_INJ_CTRL_GAP_SIZE(1) |
   369				 QS_INJ_CTRL_SOF, QS_INJ_CTRL, grp);
   370	
   371		info.port = BIT(port->chip_port);
   372		info.tag_type = IFH_TAG_TYPE_C;
   373		info.vid = skb_vlan_tag_get(skb);
   374		ocelot_gen_ifh(ifh, &info);
   375	
   376		for (i = 0; i < IFH_LEN; i++)
 > 377			ocelot_write_rix(ocelot, cpu_to_be32(ifh[i]), QS_INJ_WR, grp);
   378	
   379		count = (skb->len + 3) / 4;
   380		last = skb->len % 4;
   381		for (i = 0; i < count; i++) {
   382			ocelot_write_rix(ocelot, ((u32 *)skb->data)[i], QS_INJ_WR, grp);
   383		}
   384	
   385		/* Add padding */
   386		while (i < (OCELOT_BUFFER_CELL_SZ / 4)) {
   387			ocelot_write_rix(ocelot, 0, QS_INJ_WR, grp);
   388			i++;
   389		}
   390	
   391		/* Indicate EOF and valid bytes in last word */
   392		ocelot_write_rix(ocelot, QS_INJ_CTRL_GAP_SIZE(1) |
   393				 QS_INJ_CTRL_VLD_BYTES(skb->len < OCELOT_BUFFER_CELL_SZ ? 0 : last) |
   394				 QS_INJ_CTRL_EOF,
   395				 QS_INJ_CTRL, grp);
   396	
   397		/* Add dummy CRC */
   398		ocelot_write_rix(ocelot, 0, QS_INJ_WR, grp);
   399		skb_tx_timestamp(skb);
   400	
   401		dev->stats.tx_packets++;
   402		dev->stats.tx_bytes += skb->len;
   403		dev_kfree_skb_any(skb);
   404	
   405		return NETDEV_TX_OK;
   406	}
   407	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ