aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@gmail.com>2019-02-25 15:35:23 +0100
committerChristian Lamparter <chunkeey@gmail.com>2019-02-28 11:26:11 +0100
commitddece08bf4569d0eec865d2cbeecc551701d4467 (patch)
tree82ad6e05bd18efb96cc690eea75e98e631e98e1e /target
parentca769e081f22fce0d23ee3e54e1594d3daf9c821 (diff)
downloadupstream-ddece08bf4569d0eec865d2cbeecc551701d4467.tar.gz
upstream-ddece08bf4569d0eec865d2cbeecc551701d4467.tar.bz2
upstream-ddece08bf4569d0eec865d2cbeecc551701d4467.zip
kernel: owl-loader: fix sparse endian warnings
owl-loader.c:83:21: sparse: warning: incorrect type in assignment (different base types) owl-loader.c:83:21: sparse: expected unsigned short [usertype] reg owl-loader.c:83:21: sparse: got restricted __be16 const [usertype] reg owl-loader.c:84:21: sparse: warning: incorrect type in assignment (different base types) owl-loader.c:84:21: sparse: expected unsigned int [usertype] val owl-loader.c:84:21: sparse: got restricted __be16 const [usertype] low_val owl-loader.c:85:28: sparse: warning: restricted __be16 degrades to integer Reported-by: kbuild test robot Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Diffstat (limited to 'target')
-rw-r--r--target/linux/generic/files/drivers/misc/owl-loader.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/target/linux/generic/files/drivers/misc/owl-loader.c b/target/linux/generic/files/drivers/misc/owl-loader.c
index f11cb2b49c..5cbee79740 100644
--- a/target/linux/generic/files/drivers/misc/owl-loader.c
+++ b/target/linux/generic/files/drivers/misc/owl-loader.c
@@ -40,9 +40,9 @@ static int ath9k_pci_fixup(struct pci_dev *pdev, const u16 *cal_data,
void __iomem *mem;
const void *cal_end = (void *)cal_data + cal_len;
const struct {
- __be16 reg;
- __be16 low_val;
- __be16 high_val;
+ u16 reg;
+ u16 low_val;
+ u16 high_val;
} __packed *data;
u16 cmd;
u32 bar0;
@@ -75,14 +75,14 @@ static int ath9k_pci_fixup(struct pci_dev *pdev, const u16 *cal_data,
/* set pointer to first reg address */
for (data = (const void *) (cal_data + 3);
- (const void *) data <= cal_end && data->reg != cpu_to_be16(~0);
+ (const void *) data <= cal_end && data->reg != ~0;
data++) {
u32 val;
u16 reg;
reg = data->reg;
val = data->low_val;
- val |= data->high_val << 16;
+ val |= ((u32)data->high_val) << 16;
if (swap_needed) {
reg = swab16(reg);