Skip to content

Commit

Permalink
platform: mellanox: mlx-platform: Move bus shift assignment out of th…
Browse files Browse the repository at this point in the history
…e loop

Move assignment of bus shift setting out of the loop to avoid redundant
operation.

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Link: https://lore.kernel.org/r/20230208063331.15560-13-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
  • Loading branch information
vadimp-nvidia authored and jwrdegoede committed Feb 13, 2023
1 parent cefdbc7 commit 50b823f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/platform/x86/mlx-platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -6008,10 +6008,11 @@ static int mlxplat_mlxcpld_verify_bus_topology(int *nr)
shift = *nr - mlxplat_mux_data[i].parent;
mlxplat_mux_data[i].parent = *nr;
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;
}

Expand Down

0 comments on commit 50b823f

Please sign in to comment.