diff mbox series

[4/4] spi: spi-nxp-fspi: Fix casting warnings

Message ID 20240927132944.19285-4-hardevsinh.palaniya@siliconsignals.io (mailing list archive)
State New, archived
Headers show
Series [1/4] spi: spi-fsl-dspi: Fix casting warnings | expand

Commit Message

Hardevsinh Palaniya Sept. 27, 2024, 1:28 p.m. UTC
Sparse warnings:

drivers/spi/spi-nxp-fspi.c:512:25: warning: cast from restricted __be32

Signed-off-by: Hardevsinh Palaniya <hardevsinh.palaniya@siliconsignals.io>
---
 drivers/spi/spi-nxp-fspi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Frank Li Sept. 27, 2024, 3:47 p.m. UTC | #1
On Fri, Sep 27, 2024 at 06:58:35PM +0530, Hardevsinh Palaniya wrote:
> Sparse warnings:
>
> drivers/spi/spi-nxp-fspi.c:512:25: warning: cast from restricted __be32
>
> Signed-off-by: Hardevsinh Palaniya <hardevsinh.palaniya@siliconsignals.io>
> ---
>  drivers/spi/spi-nxp-fspi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c
> index 6585b19a4866..f602bfd11426 100644
> --- a/drivers/spi/spi-nxp-fspi.c
> +++ b/drivers/spi/spi-nxp-fspi.c
> @@ -509,7 +509,7 @@ static int fspi_readl_poll_tout(struct nxp_fspi *f, void __iomem *base,
>  	u32 reg;
>
>  	if (!f->devtype_data->little_endian)
> -		mask = (u32)cpu_to_be32(mask);
> +		mask = (__force u32)cpu_to_be32(mask);

See patch 2's comments.

Frank

>
>  	if (c)
>  		return readl_poll_timeout(base, reg, (reg & mask),
> --
> 2.43.0
>
diff mbox series

Patch

diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c
index 6585b19a4866..f602bfd11426 100644
--- a/drivers/spi/spi-nxp-fspi.c
+++ b/drivers/spi/spi-nxp-fspi.c
@@ -509,7 +509,7 @@  static int fspi_readl_poll_tout(struct nxp_fspi *f, void __iomem *base,
 	u32 reg;
 
 	if (!f->devtype_data->little_endian)
-		mask = (u32)cpu_to_be32(mask);
+		mask = (__force u32)cpu_to_be32(mask);
 
 	if (c)
 		return readl_poll_timeout(base, reg, (reg & mask),