From: Vadim Pasternak Date: Mon, 27 Sep 2021 14:22:14 +0000 (+0300) Subject: platform/mellanox: mlxreg-io: Fix read access of n-bytes size attributes X-Git-Tag: v5.15~97^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=db9cc7d6f95e7d89b0ce57e785cfd9d67a7505d8;p=platform%2Fkernel%2Flinux-starfive.git platform/mellanox: mlxreg-io: Fix read access of n-bytes size attributes Fix shift argument for function rol32(). It should be provided in bits, while was provided in bytes. Fixes: 86148190a7db ("platform/mellanox: mlxreg-io: Add support for complex attributes") Signed-off-by: Vadim Pasternak Link: https://lore.kernel.org/r/20210927142214.2613929-3-vadimp@nvidia.com Signed-off-by: Hans de Goede --- diff --git a/drivers/platform/mellanox/mlxreg-io.c b/drivers/platform/mellanox/mlxreg-io.c index a023ec0..a916cd8 100644 --- a/drivers/platform/mellanox/mlxreg-io.c +++ b/drivers/platform/mellanox/mlxreg-io.c @@ -98,7 +98,7 @@ mlxreg_io_get_reg(void *regmap, struct mlxreg_core_data *data, u32 in_val, if (ret) goto access_error; - *regval |= rol32(val, regsize * i); + *regval |= rol32(val, regsize * i * 8); } }