[linux-next:master 3635/5794] drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:3547:23: sparse: sparse: incorrect type in assignment (different base types)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   92edc4aef86780a8ad01b092c6d6630bb3cb423d
commit: d56fd83cf99c5e4b257f5be46531420509ba5066 [3635/5794] brcmfmac: fix SDIO access for big-endian host
config: powerpc-randconfig-s032-20201115 (attached as .config)
compiler: powerpc64-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-107-gaf3512a6-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=d56fd83cf99c5e4b257f5be46531420509ba5066
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout d56fd83cf99c5e4b257f5be46531420509ba5066
        # 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=powerpc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


"sparse warnings: (new ones prefixed by >>)"
>> drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:3547:23: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [addressable] [assigned] [usertype] value @@     got restricted __le32 [usertype] @@
>> drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:3547:23: sparse:     expected unsigned int [addressable] [assigned] [usertype] value
>> drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:3547:23: sparse:     got restricted __le32 [usertype]
   drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:3558:23: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [addressable] [assigned] [usertype] value @@     got restricted __le32 [usertype] @@
   drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:3558:23: sparse:     expected unsigned int [addressable] [assigned] [usertype] value
   drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:3558:23: sparse:     got restricted __le32 [usertype]

vim +3547 drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c

  3511	
  3512	
  3513	static int brcmf_sdio_bus_preinit(struct device *dev)
  3514	{
  3515		struct brcmf_bus *bus_if = dev_get_drvdata(dev);
  3516		struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio;
  3517		struct brcmf_sdio *bus = sdiodev->bus;
  3518		struct brcmf_core *core = bus->sdio_core;
  3519		u32 value;
  3520		int err;
  3521	
  3522		/* maxctl provided by common layer */
  3523		if (WARN_ON(!bus_if->maxctl))
  3524			return -EINVAL;
  3525	
  3526		/* Allocate control receive buffer */
  3527		bus_if->maxctl += bus->roundup;
  3528		value = roundup((bus_if->maxctl + SDPCM_HDRLEN), ALIGNMENT);
  3529		value += bus->head_align;
  3530		bus->rxbuf = kmalloc(value, GFP_ATOMIC);
  3531		if (bus->rxbuf)
  3532			bus->rxblen = value;
  3533	
  3534		/* the commands below use the terms tx and rx from
  3535		 * a device perspective, ie. bus:txglom affects the
  3536		 * bus transfers from device to host.
  3537		 */
  3538		if (core->rev < 12) {
  3539			/* for sdio core rev < 12, disable txgloming */
  3540			value = 0;
  3541			err = brcmf_iovar_data_set(dev, "bus:txglom", &value,
  3542						   sizeof(u32));
  3543		} else {
  3544			/* otherwise, set txglomalign */
  3545			value = sdiodev->settings->bus.sdio.sd_sgentry_align;
  3546			/* SDIO ADMA requires at least 32 bit alignment */
> 3547			value = cpu_to_le32(max_t(u32, value, ALIGNMENT));
  3548			err = brcmf_iovar_data_set(dev, "bus:txglomalign", &value,
  3549						   sizeof(u32));
  3550		}
  3551	
  3552		if (err < 0)
  3553			goto done;
  3554	
  3555		bus->tx_hdrlen = SDPCM_HWHDR_LEN + SDPCM_SWHDR_LEN;
  3556		if (sdiodev->sg_support) {
  3557			bus->txglom = false;
  3558			value = cpu_to_le32(1);
  3559			err = brcmf_iovar_data_set(bus->sdiodev->dev, "bus:rxglom",
  3560						   &value, sizeof(u32));
  3561			if (err < 0) {
  3562				/* bus:rxglom is allowed to fail */
  3563				err = 0;
  3564			} else {
  3565				bus->txglom = true;
  3566				bus->tx_hdrlen += SDPCM_HWEXT_LEN;
  3567			}
  3568		}
  3569		brcmf_bus_add_txhdrlen(bus->sdiodev->dev, bus->tx_hdrlen);
  3570	
  3571	done:
  3572		return err;
  3573	}
  3574	

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux