Skip to content

Commit 08e019e

Browse files
kblaiechwsakernel
authored andcommitted
i2c: mlxbf: Fix resrticted cast warning of sparse
Address warnings "warning: cast to restricted __be32" reported by sparse. Fixes: b5b5b32 ("i2c: mlxbf: I2C SMBus driver for Mellanox BlueField SoC") Reported-by: kernel test robot <lkp@intel.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Reviewed-by: Vadim Pasternak <vadimp@nvidia.com> Signed-off-by: Khalil Blaiech <kblaiech@nvidia.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
1 parent ed01ddc commit 08e019e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/i2c/busses/i2c-mlxbf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ static u32 mlxbf_i2c_read(void __iomem *io, int reg)
510510
*/
511511
static u32 mlxbf_i2c_read_data(void __iomem *io, int reg)
512512
{
513-
return (u32)be32_to_cpu(mlxbf_i2c_read(io, reg));
513+
return ioread32be(io + reg);
514514
}
515515

516516
/*
@@ -524,7 +524,7 @@ static u32 mlxbf_i2c_read_data(void __iomem *io, int reg)
524524
*/
525525
static void mlxbf_i2c_write_data(void __iomem *io, int reg, u32 val)
526526
{
527-
mlxbf_i2c_write(io, reg, (u32)cpu_to_be32(val));
527+
iowrite32be(val, io + reg);
528528
}
529529

530530
/*

0 commit comments

Comments
 (0)