Skip to contentSkip to conversation

PCI: cadence: Fix enum type mismatch warning in LTSSM debugfs

PATCH Applied Hans Zhang 4 participants 4 messages Aug 20 – Sep 1

Subsystems (3)
lore
Share & tools
lore

Hans Zhang

author
#0 lore raw

PATCH 1/1 PCI: cadence: Fix enum type mismatch warning in LTSSM debugfs

Fix Clang -Wenum-compare-conditional warning by using a single u32 variable to hold the LTSSM status value, replacing two separate enum variables of different types.

Fixes d70e964dc099 ("PCI: cadence: Add LGA IP debugfs for LTSSM status")
---
 .../pci/controller/cadence/pcie-cadence-debugfs.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
drivers/pci/controller/cadence/pcie-cadence-debugfs.c +6 -9
index 0a308f95e9f6..7b8354052aea 100644
@@ -210,24 +210,21 @@ static const char *cdns_pcie_hpa_ltssm_status_string(enum cdns_pcie_hpa_ltssm lt
 static int ltssm_status_show(struct seq_file *s, void *v)
 {
 	struct cdns_pcie *pci = s->private;
-	enum cdns_pcie_lga_ltssm lga_ltssm;
-	enum cdns_pcie_hpa_ltssm hpa_ltssm;
 	const char *str_ltssm;
-	u32 val;
+	u32 val, ltssm_val;
 
 	if (pci->is_hpa) {
 		val = cdns_pcie_hpa_readl(pci, REG_BANK_IP_REG,
 					  CDNS_PCIE_HPA_PHY_DBG_STS_REG0);
-		hpa_ltssm = FIELD_GET(CDNS_PCIE_HPA_LTSSM_STATUS_MASK, val);
-		str_ltssm = cdns_pcie_hpa_ltssm_status_string(hpa_ltssm);
+		ltssm_val = FIELD_GET(CDNS_PCIE_HPA_LTSSM_STATUS_MASK, val);
+		str_ltssm = cdns_pcie_hpa_ltssm_status_string(ltssm_val);
 	} else {
 		val = cdns_pcie_readl(pci, CDNS_PCIE_LM_BASE);
-		lga_ltssm = FIELD_GET(CDNS_PCIE_LGA_LTSSM_STATUS_MASK, val);
-		str_ltssm = cdns_pcie_lga_ltssm_status_string(lga_ltssm);
+		ltssm_val = FIELD_GET(CDNS_PCIE_LGA_LTSSM_STATUS_MASK, val);
+		str_ltssm = cdns_pcie_lga_ltssm_status_string(ltssm_val);
 	}
 
-	seq_printf(s, "%s (0x%02x)\n", str_ltssm,
-		   pci->is_hpa ? hpa_ltssm : lga_ltssm);
+	seq_printf(s, "%s (0x%02x)\n", str_ltssm, ltssm_val);
 
 	return 0;
 }
Signature · 1 line
2.34.1
#1 lore raw
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 8 lines

Fix Clang -Wenum-compare-conditional warning by using a single u32 variable to hold the LTSSM status value, replacing two separate enum variables of different types.

Fixes d70e964dc099 ("PCI: cadence: Add LGA IP debugfs for LTSSM status")

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
reviewer Reviewed-by on v1 1/1
#2 lore raw
In reply to Hans Zhang
Quoted 8 lines · Hans Zhang

Fix Clang -Wenum-compare-conditional warning by using a single u32 variable to hold the LTSSM status value, replacing two separate enum variables of different types.

Fixes d70e964dc099 ("PCI: cadence: Add LGA IP debugfs for LTSSM status")

Regards,
Aksh Garg

#3 lore raw
In reply to Hans Zhang
Quoted 3 lines · Hans Zhang

Fix Clang -Wenum-compare-conditional warning by using a single u32 variable to hold the LTSSM status value, replacing two separate enum variables of different types.

Applied, thanks!

[1/1] PCI: cadence: Fix enum type mismatch warning in LTSSM debugfs

      commit: ce8034bb9c5c50f9f5c305856aff5d1c3efe3a30

Best regards,

Signature · 1 line
மணிவண்ணன் சதாசிவம்