Commit 50b823fd authored by Vadim Pasternak's avatar Vadim Pasternak Committed by Hans de Goede

platform: mellanox: mlx-platform: Move bus shift assignment out of the loop

Move assignment of bus shift setting out of the loop to avoid redundant
operation.
Signed-off-by: default avatarVadim Pasternak <vadimp@nvidia.com>
Reviewed-by: default avatarMichael Shych <michaelsh@nvidia.com>
Link: https://lore.kernel.org/r/20230208063331.15560-13-vadimp@nvidia.comSigned-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent cefdbc78
...@@ -6008,10 +6008,11 @@ static int mlxplat_mlxcpld_verify_bus_topology(int *nr) ...@@ -6008,10 +6008,11 @@ static int mlxplat_mlxcpld_verify_bus_topology(int *nr)
shift = *nr - mlxplat_mux_data[i].parent; shift = *nr - mlxplat_mux_data[i].parent;
mlxplat_mux_data[i].parent = *nr; mlxplat_mux_data[i].parent = *nr;
mlxplat_mux_data[i].base_nr += shift; mlxplat_mux_data[i].base_nr += shift;
if (shift > 0)
mlxplat_hotplug->shift_nr = shift;
} }
if (shift > 0)
mlxplat_hotplug->shift_nr = shift;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment