diff options
| author | Shyam Sundar S K <[email protected]> | 2024-11-08 07:08:18 +0000 |
|---|---|---|
| committer | Ilpo Järvinen <[email protected]> | 2024-12-02 17:31:46 +0000 |
| commit | 0b4c20ff2bca843a51a75ac53832a9b2f0645bc5 (patch) | |
| tree | 70e3ac5a83c0f6460eb94a7e53b3ae3860c1c19e | |
| parent | platform/x86/amd/pmc: Isolate STB code changes to a new file (diff) | |
| download | kernel-0b4c20ff2bca843a51a75ac53832a9b2f0645bc5.tar.gz kernel-0b4c20ff2bca843a51a75ac53832a9b2f0645bc5.zip | |
platform/x86/amd/pmc: Use ARRAY_SIZE() to fill num_ips information
Instead of manually specifying num_ips, use ARRAY_SIZE() to set this value
based on the actual number of elements in the array.
Reviewed-by: Ilpo Jarvinen <[email protected]>
Reviewed-by: Mario Limonciello <[email protected]>
Co-developed-by: Sanket Goswami <[email protected]>
Signed-off-by: Sanket Goswami <[email protected]>
Signed-off-by: Shyam Sundar S K <[email protected]>
Reviewed-by: Ilpo Järvinen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Ilpo Järvinen <[email protected]>
| -rw-r--r-- | drivers/platform/x86/amd/pmc/pmc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c index 7b3a367814b0..147644e5026b 100644 --- a/drivers/platform/x86/amd/pmc/pmc.c +++ b/drivers/platform/x86/amd/pmc/pmc.c @@ -12,6 +12,7 @@ #include <asm/amd_nb.h> #include <linux/acpi.h> +#include <linux/array_size.h> #include <linux/bitfield.h> #include <linux/bits.h> #include <linux/debugfs.h> @@ -117,7 +118,6 @@ static const struct amd_pmc_bit_map soc15_ip_blk[] = { {"IPU", BIT(19)}, {"UMSCH", BIT(20)}, {"VPE", BIT(21)}, - {} }; static bool disable_workarounds; @@ -169,7 +169,7 @@ static void amd_pmc_get_ip_info(struct amd_pmc_dev *dev) break; case PCI_DEVICE_ID_AMD_1AH_M20H_ROOT: case PCI_DEVICE_ID_AMD_1AH_M60H_ROOT: - dev->num_ips = 22; + dev->num_ips = ARRAY_SIZE(soc15_ip_blk); dev->smu_msg = 0x938; break; } |
