Skip to contentSkip to conversation

usb: typec: qcom: set pm8150b_typec_res storage-class-specifier to static

PATCH In review Tom Rix 4 participants 4 messages May 15, 2023

Subsystems (4)
lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 usb: typec: qcom: set pm8150b_typec_res storage-class-specifier to static

smatch reports drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c:323:29: warning: symbol
'pm8150b_typec_res' was not declared. Should it be static?

This variable is only used in its defining file, so it should be static

---
 drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c +1 -1
index 191458ce4a06..937e855a6c4c 100644
@@ -320,7 +320,7 @@ static struct pmic_typec_port_resources pm8150b_port_res = {
 	.nr_irqs = 7,
 };
 
-struct pmic_typec_resources pm8150b_typec_res = {
+static struct pmic_typec_resources pm8150b_typec_res = {
 	.pdphy_res = &pm8150b_pdphy_res,
 	.port_res = &pm8150b_port_res,
 };
Signature · 1 line
2.27.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Tom Rix

smatch reports drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c:323:29: warning: symbol
'pm8150b_typec_res' was not declared. Should it be static?

This variable is only used in its defining file, so it should be static

---
  drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c +0 -0
index 191458ce4a06..937e855a6c4c 100644

drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c static struct pmic_typec_port_resources pm8150b_port_res = { · line 326

Quoted 8 lines
drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c +1 -1
@@ -320,7 +320,7 @@ static struct pmic_typec_port_resources pm8150b_port_res = {
  	.nr_irqs = 7,
  };
 
-struct pmic_typec_resources pm8150b_typec_res = {
+static struct pmic_typec_resources pm8150b_typec_res = {
  	.pdphy_res = &pm8150b_pdphy_res,
  	.port_res = &pm8150b_port_res,
  };
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Tom Rix
Quoted 7 lines · Tom Rix

smatch reports drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c:323:29: warning: symbol
'pm8150b_typec_res' was not declared. Should it be static?

This variable is only used in its defining file, so it should be static

Quoted 17 lines
---
 drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c +1 -1
index 191458ce4a06..937e855a6c4c 100644
@@ -320,7 +320,7 @@ static struct pmic_typec_port_resources pm8150b_port_res = {
 	.nr_irqs = 7,
 };
 
-struct pmic_typec_resources pm8150b_typec_res = {
+static struct pmic_typec_resources pm8150b_typec_res = {
 	.pdphy_res = &pm8150b_pdphy_res,
 	.port_res = &pm8150b_port_res,
 };
Signature · 1 line
heikki
Reviewed-by on v1 1/1
#3 lore raw
In reply to Tom Rix
Quoted 7 lines · Tom Rix

smatch reports drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c:323:29: warning: symbol
'pm8150b_typec_res' was not declared. Should it be static?

This variable is only used in its defining file, so it should be static

Guenter

Quoted 20 lines
---
 drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c +1 -1
index 191458ce4a06..937e855a6c4c 100644
@@ -320,7 +320,7 @@ static struct pmic_typec_port_resources pm8150b_port_res = {
 	.nr_irqs = 7,
 };
 
-struct pmic_typec_resources pm8150b_typec_res = {
+static struct pmic_typec_resources pm8150b_typec_res = {
 	.pdphy_res = &pm8150b_pdphy_res,
 	.port_res = &pm8150b_port_res,
 };
Signature · 1 line
2.27.0