[PATCH 4/9] platform/x86:intel/pmc: Move pmc assignment closer to first usage

Xi Pardee
2024-06-24T20:32:26Z

Move pmc variable assignment closer to the conditional statement of
its first use for better readability.

Signed-off-by: Xi Pardee <xi.pardee@linux.intel.com>
---
drivers/platform/x86/intel/pmc/core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/intel/pmc/core.c
index cbdcbf288f67..cb7dd22e7406 100644
--- a/drivers/platform/x86/intel/pmc/core.c
+++ b/drivers/platform/x86/intel/pmc/core.c
@@ -621,9 +621,10 @@ static int pmc_core_ltr_show(struct seq_file *s, void *unused)
unsigned int i, index, ltr_index = 0;

for (i = 0; i < ARRAY_SIZE(pmcdev->pmcs); ++i) {
- struct pmc *pmc = pmcdev->pmcs[i];
+ struct pmc *pmc;
const struct pmc_bit_map *map;

+ pmc = pmcdev->pmcs[i];
if (!pmc)
continue;

--
2.34.1