Skip to contentSkip to conversation

usb: typec: tcpm: remove useless variable

PATCH In review Jiapeng Chong 2 participants 2 messages Apr 9, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: typec: tcpm: remove useless variable

Fix the following gcc warning:

drivers/usb/typec/tcpm/tcpm.c:2107:39: warning: ‘tcpm_altmode_ops’ defined but not used [-Wunused-const-variable=].

---
 drivers/usb/typec/tcpm/tcpm.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/usb/typec/tcpm/tcpm.c +0 -6
index ce7af39..4585785 100644
@@ -2104,12 +2104,6 @@ static int tcpm_altmode_vdm(struct typec_altmode *altmode,
 	return 0;
 }
 
-static const struct typec_altmode_ops tcpm_altmode_ops = {
-	.enter = tcpm_altmode_enter,
-	.exit = tcpm_altmode_exit,
-	.vdm = tcpm_altmode_vdm,
-};
-
 /*
  * PD (data, control) command handling functions
  */
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw
Quoted 16 lines · Jiapeng Chong

Fix the following gcc warning:

drivers/usb/typec/tcpm/tcpm.c:2107:39: warning: ‘tcpm_altmode_ops’ defined but not used [-Wunused-const-variable=].

---
 drivers/usb/typec/tcpm/tcpm.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/usb/typec/tcpm/tcpm.c +0 -0
index ce7af39..4585785 100644

drivers/usb/typec/tcpm/tcpm.c static int tcpm_altmode_vdm(struct typec_altmode *altmode, · line 2111

Quoted 8 lines
drivers/usb/typec/tcpm/tcpm.c +0 -5
@@ -2104,12 +2104,6 @@ static int tcpm_altmode_vdm(struct typec_altmode *altmode,
 	return 0;
 }
 
-static const struct typec_altmode_ops tcpm_altmode_ops = {
-	.enter = tcpm_altmode_enter,
-	.exit = tcpm_altmode_exit,
-	.vdm = tcpm_altmode_vdm,
-};

You remove that but leave the functions. That should create even more warnings for you, because now there are no users for those functions.

There is another, more complete patch for this, but I don't think we should take either of these now. We about to get a user for tcpm_altmode_ops.

Br,

Signature · 1 line
heikki