Skip to content

Commit d430e4a

Browse files
ffainellimiquelraynal
authored andcommitted
mtd: rawnand: brcmnand: Fix sparse warnings in bcma_nand
sparse was unhappy about the way we woulc call cpu_to_be32/be32_to_cpu, apply the appropriate casting to silence the warnings. Reported-by: kernel test robot <[email protected]> Link: https://lists.01.org/hyperkitty/list/[email protected]/thread/ZNHPJFYLO64EGI5QUT7HZ63J7O5J2G7N/ Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
1 parent 2212c19 commit d430e4a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/mtd/nand/raw/brcmnand/bcma_nand.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static u32 brcmnand_bcma_read_reg(struct brcmnand_soc *soc, u32 offset)
5858

5959
/* Swap if necessary */
6060
if (brcmnand_bcma_needs_swapping(offset))
61-
val = be32_to_cpu(val);
61+
val = be32_to_cpu((__force __be32)val);
6262
return val;
6363
}
6464

@@ -75,7 +75,7 @@ static void brcmnand_bcma_write_reg(struct brcmnand_soc *soc, u32 val,
7575

7676
/* Swap if necessary */
7777
if (brcmnand_bcma_needs_swapping(offset))
78-
val = cpu_to_be32(val);
78+
val = (__force u32)cpu_to_be32(val);
7979

8080
bcma_cc_write32(sc->cc, offset, val);
8181
}

0 commit comments

Comments
 (0)