summaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorVadim Pasternak <vadimp@nvidia.com>2023-02-08 07:33:29 +0100
committerHans de Goede <hdegoede@redhat.com>2023-02-13 12:07:50 +0100
commit50b823fdd357ec0f2fd0a1a0b5104704916fd620 (patch)
treea56624ef93b106c51e995e013141159e357fb963 /drivers/platform
parentplatform: mellanox: mlx-platform: Add mux selection register to regmap (diff)
downloadlinux-50b823fdd357ec0f2fd0a1a0b5104704916fd620.tar.xz
linux-50b823fdd357ec0f2fd0a1a0b5104704916fd620.zip
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: 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>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/mlx-platform.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
index 60062d9f3b9b..7b6779cdb134 100644
--- a/drivers/platform/x86/mlx-platform.c
+++ b/drivers/platform/x86/mlx-platform.c
@@ -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;
}