Skip to content

Commit 66c1c41

Browse files
hardevsinh-1broonie
authored andcommitted
spi: spi-fsl-dspi: Fix casting warnings
Sparse warnings: drivers/spi/spi-fsl-dspi.c:283:17: warning: incorrect type in assignment (different base types) drivers/spi/spi-fsl-dspi.c:283:17: expected unsigned int [usertype] drivers/spi/spi-fsl-dspi.c:283:17: got restricted __be32 [usertype] drivers/spi/spi-fsl-dspi.c:289:28: warning: cast to restricted __be32 drivers/spi/spi-fsl-dspi.c:289:28: warning: cast to restricted __be32 drivers/spi/spi-fsl-dspi.c:289:28: warning: cast to restricted __be32 drivers/spi/spi-fsl-dspi.c:289:28: warning: cast to restricted __be32 drivers/spi/spi-fsl-dspi.c:289:28: warning: cast to restricted __be32 drivers/spi/spi-fsl-dspi.c:289:28: warning: cast to restricted __be32 drivers/spi/spi-fsl-dspi.c:295:17: warning: incorrect type in assignment (different base types) drivers/spi/spi-fsl-dspi.c:295:17: expected unsigned int [usertype] drivers/spi/spi-fsl-dspi.c:295:17: got restricted __be16 [usertype] drivers/spi/spi-fsl-dspi.c:301:28: warning: cast to restricted __be16 drivers/spi/spi-fsl-dspi.c:301:28: warning: cast to restricted __be16 drivers/spi/spi-fsl-dspi.c:301:28: warning: cast to restricted __be16 drivers/spi/spi-fsl-dspi.c:301:28: warning: cast to restricted __be16 Signed-off-by: Hardevsinh Palaniya <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Tested-by: Vladimir Oltean <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent c2a59c8 commit 66c1c41

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/spi/spi-fsl-dspi.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,25 +280,25 @@ static void dspi_native_dev_to_host(struct fsl_dspi *dspi, u32 rxdata)
280280

281281
static void dspi_8on32_host_to_dev(struct fsl_dspi *dspi, u32 *txdata)
282282
{
283-
*txdata = cpu_to_be32(*(u32 *)dspi->tx);
283+
*txdata = (__force u32)cpu_to_be32(*(u32 *)dspi->tx);
284284
dspi->tx += sizeof(u32);
285285
}
286286

287287
static void dspi_8on32_dev_to_host(struct fsl_dspi *dspi, u32 rxdata)
288288
{
289-
*(u32 *)dspi->rx = be32_to_cpu(rxdata);
289+
*(u32 *)dspi->rx = be32_to_cpu((__force __be32)rxdata);
290290
dspi->rx += sizeof(u32);
291291
}
292292

293293
static void dspi_8on16_host_to_dev(struct fsl_dspi *dspi, u32 *txdata)
294294
{
295-
*txdata = cpu_to_be16(*(u16 *)dspi->tx);
295+
*txdata = (__force u32)cpu_to_be16(*(u16 *)dspi->tx);
296296
dspi->tx += sizeof(u16);
297297
}
298298

299299
static void dspi_8on16_dev_to_host(struct fsl_dspi *dspi, u32 rxdata)
300300
{
301-
*(u16 *)dspi->rx = be16_to_cpu(rxdata);
301+
*(u16 *)dspi->rx = be16_to_cpu((__force __be16)rxdata);
302302
dspi->rx += sizeof(u16);
303303
}
304304

0 commit comments

Comments
 (0)