platform/x86:intel/pmc: Convert index variables to be unsigned
authorXi Pardee <xi.pardee@linux.intel.com>
Wed, 9 Apr 2025 19:10:46 +0000 (12:10 -0700)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Fri, 11 Apr 2025 12:26:06 +0000 (15:26 +0300)
Convert the index variables type to be unsigned to avoid confusion
and error.

Signed-off-by: Xi Pardee <xi.pardee@linux.intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20250409191056.15434-5-xi.pardee@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/intel/pmc/core.c
drivers/platform/x86/intel/pmc/core.h
drivers/platform/x86/intel/pmc/ssram_telemetry.c

index a42dc62d70dabc516fb142b8000ce51317f7efa2..a53a7677122c8961f359349a33c682b968af4d7a 100644 (file)
@@ -1457,7 +1457,8 @@ unregister_ep:
 
 static int pmc_core_ssram_get_lpm_reqs(struct pmc_dev *pmcdev)
 {
-       int ret, i;
+       unsigned int i;
+       int ret;
 
        if (!pmcdev->ssram_pcidev)
                return -ENODEV;
@@ -1484,7 +1485,7 @@ const struct pmc_reg_map *pmc_core_find_regmap(struct pmc_info *list, u16 devid)
 }
 
 int pmc_core_pmc_add(struct pmc_dev *pmcdev, u64 pwrm_base,
-                    const struct pmc_reg_map *reg_map, int pmc_index)
+                    const struct pmc_reg_map *reg_map, unsigned int pmc_index)
 {
        struct pmc *pmc = pmcdev->pmcs[pmc_index];
 
index ce1b949b10040820f6eb7c1709f79fefceb1201d..c3b07075d017b9b12332442958ef268e53c10c39 100644 (file)
@@ -515,7 +515,7 @@ int pmc_core_ssram_init(struct pmc_dev *pmcdev, int func);
 int generic_core_init(struct pmc_dev *pmcdev, struct pmc_dev_info *pmc_dev_info);
 const struct pmc_reg_map *pmc_core_find_regmap(struct pmc_info *list, u16 devid);
 int pmc_core_pmc_add(struct pmc_dev *pmcdev, u64 pwrm_base,
-                    const struct pmc_reg_map *reg_map, int pmc_index);
+                    const struct pmc_reg_map *reg_map, unsigned int pmc_index);
 
 extern struct pmc_dev_info spt_pmc_dev;
 extern struct pmc_dev_info cnp_pmc_dev;
index e1a83425d802d67f515236e1dad4a4d245a4ea85..10ead4398a68ad667fea5f4b4df991ba4c7bb724 100644 (file)
@@ -74,7 +74,7 @@ static inline u64 get_base(void __iomem *addr, u32 offset)
 }
 
 static int
-pmc_core_ssram_get_pmc(struct pmc_dev *pmcdev, int pmc_idx, u32 offset)
+pmc_core_ssram_get_pmc(struct pmc_dev *pmcdev, unsigned int pmc_idx, u32 offset)
 {
        struct pci_dev *ssram_pcidev = pmcdev->ssram_pcidev;
        void __iomem __free(pmc_core_iounmap) *tmp_ssram = NULL;