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: 86148190a7 ("platform/mellanox: mlxreg-io: Add support for complex attributes")
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Link: https://lore.kernel.org/r/20210927142214.2613929-3-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
Vadim Pasternak 2021-09-27 17:22:14 +03:00 committed by Hans de Goede
parent 452dcfab99
commit 5fd56f1183

View file

@ -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);
}
}