Skip to contentSkip to conversation

phy: qcom-qmp: initialize the pointer to NULL

PATCH In review Vinod Koul 2 participants 3 messages Oct 1, 2020

Subsystems (2)
lore
Share & tools
lore

Vinod Koul

author maintainer
#0 lore raw

PATCH 1/1 phy: qcom-qmp: initialize the pointer to NULL

Smatch complains:
drivers/phy/qualcomm/phy-qcom-qmp.c:3899 qcom_qmp_phy_probe() error: uninitialized symbol 'dp_cfg'. drivers/phy/qualcomm/phy-qcom-qmp.c:3900 qcom_qmp_phy_probe() error: uninitialized symbol 'dp_serdes'. drivers/phy/qualcomm/phy-qcom-qmp.c:3902 qcom_qmp_phy_probe() error: uninitialized symbol 'usb_cfg'.

This is a warning but not a practical one as dp_cfg, dp_serdes and usb_cfg will be set and used when valid. So we can set the pointers to NULL to quiesce the warnings.

Fixes 52e013d0bffa ("phy: qcom-qmp: Add support for DP in USB3+DP combo phy")
---
 drivers/phy/qualcomm/phy-qcom-qmp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp.c +3 -3
index 6171b44da050..5d33ad4d06f2 100644
@@ -3928,9 +3928,9 @@ static int qcom_qmp_phy_probe(struct platform_device *pdev)
 	void __iomem *usb_serdes;
 	void __iomem *dp_serdes;
 	const struct qmp_phy_combo_cfg *combo_cfg = NULL;
-	const struct qmp_phy_cfg *cfg;
-	const struct qmp_phy_cfg *usb_cfg;
-	const struct qmp_phy_cfg *dp_cfg;
+	const struct qmp_phy_cfg *cfg = NULL;
+	const struct qmp_phy_cfg *usb_cfg = NULL;
+	const struct qmp_phy_cfg *dp_cfg = NULL;
 	int num, id, expected_phys;
 	int ret;
 
Signature · 1 line
2.26.2
Reviewed-by on v1 1/1
#1 lore raw

Quoting Vinod Koul (2020-10-01 00:09:11)

Quoted 9 lines

Smatch complains:
drivers/phy/qualcomm/phy-qcom-qmp.c:3899 qcom_qmp_phy_probe() error: uninitialized symbol 'dp_cfg'. drivers/phy/qualcomm/phy-qcom-qmp.c:3900 qcom_qmp_phy_probe() error: uninitialized symbol 'dp_serdes'. drivers/phy/qualcomm/phy-qcom-qmp.c:3902 qcom_qmp_phy_probe() error: uninitialized symbol 'usb_cfg'.

This is a warning but not a practical one as dp_cfg, dp_serdes and usb_cfg will be set and used when valid. So we can set the pointers to NULL to quiesce the warnings.

Quoted 5 lines
Fixes 52e013d0bffa ("phy: qcom-qmp: Add support for DP in USB3+DP combo phy")

---

Thanks!

author maintainer
#2 lore raw
Quoted 16 lines · Stephen Boyd

Quoting Vinod Koul (2020-10-01 00:09:11)

Quoted 9 lines

Smatch complains:
drivers/phy/qualcomm/phy-qcom-qmp.c:3899 qcom_qmp_phy_probe() error: uninitialized symbol 'dp_cfg'. drivers/phy/qualcomm/phy-qcom-qmp.c:3900 qcom_qmp_phy_probe() error: uninitialized symbol 'dp_serdes'. drivers/phy/qualcomm/phy-qcom-qmp.c:3902 qcom_qmp_phy_probe() error: uninitialized symbol 'usb_cfg'.

This is a warning but not a practical one as dp_cfg, dp_serdes and usb_cfg will be set and used when valid. So we can set the pointers to NULL to quiesce the warnings.

Quoted 5 lines
Fixes 52e013d0bffa ("phy: qcom-qmp: Add support for DP in USB3+DP combo phy")

---

Quoted 3 lines

Thanks!

Thanks for quick review, applied and pushed now

Signature · 1 line
~Vinod