[soc:broadcom/drivers 2/4] drivers/soc/bcm/bcm63xx/bcm-pmb.c:103:45: sparse: sparse: cast to restricted __le32
kernel test robot
lkp at intel.com
Wed Feb 10 16:48:33 EST 2021
tree: https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git broadcom/drivers
head: 8b8f095b9076ca61107c0910c9273afd1dfa1f04
commit: 8bcac4011ebe0dbdd46fd55b036ee855c95702d3 [2/4] soc: bcm: add PM driver for Broadcom's PMB
config: i386-randconfig-s002-20210211 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-215-g0fb77bb6-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git/commit/?id=8bcac4011ebe0dbdd46fd55b036ee855c95702d3
git remote add soc https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git
git fetch --no-tags soc broadcom/drivers
git checkout 8bcac4011ebe0dbdd46fd55b036ee855c95702d3
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>
"sparse warnings: (new ones prefixed by >>)"
drivers/soc/bcm/bcm63xx/bcm-pmb.c:103:65: sparse: sparse: cast to restricted __be32
drivers/soc/bcm/bcm63xx/bcm-pmb.c:103:65: sparse: sparse: cast to restricted __be32
drivers/soc/bcm/bcm63xx/bcm-pmb.c:103:65: sparse: sparse: cast to restricted __be32
drivers/soc/bcm/bcm63xx/bcm-pmb.c:103:65: sparse: sparse: cast to restricted __be32
drivers/soc/bcm/bcm63xx/bcm-pmb.c:103:65: sparse: sparse: cast to restricted __be32
drivers/soc/bcm/bcm63xx/bcm-pmb.c:103:65: sparse: sparse: cast to restricted __be32
>> drivers/soc/bcm/bcm63xx/bcm-pmb.c:103:45: sparse: sparse: cast to restricted __le32
>> drivers/soc/bcm/bcm63xx/bcm-pmb.c:115:36: sparse: sparse: restricted __le32 degrades to integer
drivers/soc/bcm/bcm63xx/bcm-pmb.c:115:55: sparse: sparse: restricted __be32 degrades to integer
vim +103 drivers/soc/bcm/bcm63xx/bcm-pmb.c
90
91 static int bcm_pmb_bpcm_read(struct bcm_pmb *pmb, int bus, u8 device,
92 int offset, u32 *val)
93 {
94 void __iomem *base = pmb->base + bus * 0x20;
95 unsigned long flags;
96 int err;
97
98 spin_lock_irqsave(&pmb->lock, flags);
99 err = bpcm_rd(base, device, offset, val);
100 spin_unlock_irqrestore(&pmb->lock, flags);
101
102 if (!err)
> 103 *val = pmb->little_endian ? le32_to_cpu(*val) : be32_to_cpu(*val);
104
105 return err;
106 }
107
108 static int bcm_pmb_bpcm_write(struct bcm_pmb *pmb, int bus, u8 device,
109 int offset, u32 val)
110 {
111 void __iomem *base = pmb->base + bus * 0x20;
112 unsigned long flags;
113 int err;
114
> 115 val = pmb->little_endian ? cpu_to_le32(val) : cpu_to_be32(val);
116
117 spin_lock_irqsave(&pmb->lock, flags);
118 err = bpcm_wr(base, device, offset, val);
119 spin_unlock_irqrestore(&pmb->lock, flags);
120
121 return err;
122 }
123
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 52791 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20210211/d067c0e4/attachment-0001.gz>
More information about the linux-arm-kernel
mailing list