Skip to contentSkip to conversation

usb: typec: tcpm: remove unused static variable 'tcpm_altmode_ops'

PATCH In review Zhen Lei 5 participants 10 messages Apr 7, 2021 – Apr 9, 2021

Subsystems (3)
lore
Share & tools
lore

Zhen Lei

author
#0 lore raw

PATCH 1/1 usb: typec: tcpm: remove unused static variable 'tcpm_altmode_ops'

Fixes the following W=1 kernel build warning:

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

The reference to the variable 'tcpm_altmode_ops' is deleted by the commit a079973f462a ("usb: typec: tcpm: Remove tcpc_config configuration mechanism").

By the way, the static functions referenced only by the variable 'tcpm_altmode_ops' are deleted accordingly.

---
 drivers/usb/typec/tcpm/tcpm.c | 60 -------------------------------------------
 1 file changed, 60 deletions(-)
drivers/usb/typec/tcpm/tcpm.c +0 -60
index ce7af398c7c1c1f..2f89bae29c0c297 100644
@@ -1365,14 +1365,6 @@ static void tcpm_queue_vdm(struct tcpm_port *port, const u32 header,
 	mod_vdm_delayed_work(port, 0);
 }
 
-static void tcpm_queue_vdm_unlocked(struct tcpm_port *port, const u32 header,
-				    const u32 *data, int cnt)
-{
-	mutex_lock(&port->lock);
-	tcpm_queue_vdm(port, header, data, cnt);
-	mutex_unlock(&port->lock);
-}
-
 static void svdm_consume_identity(struct tcpm_port *port, const u32 *p, int cnt)
 {
 	u32 vdo = p[VDO_INDEX_IDH];
@@ -1705,8 +1697,6 @@ static void tcpm_handle_vdm_request(struct tcpm_port *port,
 	 *
 	 * And we also have this ordering:
 	 * 1. alt-mode driver takes the alt-mode's lock
-	 * 2. alt-mode driver calls tcpm_altmode_enter which takes the
-	 *    tcpm port lock
 	 *
 	 * Dropping our lock here avoids this.
 	 */
@@ -2060,56 +2050,6 @@ static int tcpm_validate_caps(struct tcpm_port *port, const u32 *pdo,
 	return 0;
 }
 
-static int tcpm_altmode_enter(struct typec_altmode *altmode, u32 *vdo)
-{
-	struct tcpm_port *port = typec_altmode_get_drvdata(altmode);
-	int svdm_version;
-	u32 header;
-
-	svdm_version = typec_get_negotiated_svdm_version(port->typec_port);
-	if (svdm_version < 0)
-		return svdm_version;
-
-	header = VDO(altmode->svid, vdo ? 2 : 1, svdm_version, CMD_ENTER_MODE);
-	header |= VDO_OPOS(altmode->mode);
-
-	tcpm_queue_vdm_unlocked(port, header, vdo, vdo ? 1 : 0);
-	return 0;
-}
-
-static int tcpm_altmode_exit(struct typec_altmode *altmode)
-{
-	struct tcpm_port *port = typec_altmode_get_drvdata(altmode);
-	int svdm_version;
-	u32 header;
-
-	svdm_version = typec_get_negotiated_svdm_version(port->typec_port);
-	if (svdm_version < 0)
-		return svdm_version;
-
-	header = VDO(altmode->svid, 1, svdm_version, CMD_EXIT_MODE);
-	header |= VDO_OPOS(altmode->mode);
-
-	tcpm_queue_vdm_unlocked(port, header, NULL, 0);
-	return 0;
-}
-
-static int tcpm_altmode_vdm(struct typec_altmode *altmode,
-			    u32 header, const u32 *data, int count)
-{
-	struct tcpm_port *port = typec_altmode_get_drvdata(altmode);
-
-	tcpm_queue_vdm_unlocked(port, header, data, count - 1);
-
-	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
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Zhen Lei

Fixes the following W=1 kernel build warning:

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

The reference to the variable 'tcpm_altmode_ops' is deleted by the commit a079973f462a ("usb: typec: tcpm: Remove tcpc_config configuration mechanism").

Quoted 5 lines

By the way, the static functions referenced only by the variable 'tcpm_altmode_ops' are deleted accordingly.

Oh, I thought this was already fixed. Should this go into the stable trees as well?

Quoted 92 lines
---
 drivers/usb/typec/tcpm/tcpm.c | 60 -------------------------------------------
 1 file changed, 60 deletions(-)
drivers/usb/typec/tcpm/tcpm.c +0 -60
index ce7af398c7c1c1f..2f89bae29c0c297 100644
@@ -1365,14 +1365,6 @@ static void tcpm_queue_vdm(struct tcpm_port *port, const u32 header,
 	mod_vdm_delayed_work(port, 0);
 }
 
-static void tcpm_queue_vdm_unlocked(struct tcpm_port *port, const u32 header,
-				    const u32 *data, int cnt)
-{
-	mutex_lock(&port->lock);
-	tcpm_queue_vdm(port, header, data, cnt);
-	mutex_unlock(&port->lock);
-}
-
 static void svdm_consume_identity(struct tcpm_port *port, const u32 *p, int cnt)
 {
 	u32 vdo = p[VDO_INDEX_IDH];
@@ -1705,8 +1697,6 @@ static void tcpm_handle_vdm_request(struct tcpm_port *port,
 	 *
 	 * And we also have this ordering:
 	 * 1. alt-mode driver takes the alt-mode's lock
-	 * 2. alt-mode driver calls tcpm_altmode_enter which takes the
-	 *    tcpm port lock
 	 *
 	 * Dropping our lock here avoids this.
 	 */
@@ -2060,56 +2050,6 @@ static int tcpm_validate_caps(struct tcpm_port *port, const u32 *pdo,
 	return 0;
 }
 
-static int tcpm_altmode_enter(struct typec_altmode *altmode, u32 *vdo)
-{
-	struct tcpm_port *port = typec_altmode_get_drvdata(altmode);
-	int svdm_version;
-	u32 header;
-
-	svdm_version = typec_get_negotiated_svdm_version(port->typec_port);
-	if (svdm_version < 0)
-		return svdm_version;
-
-	header = VDO(altmode->svid, vdo ? 2 : 1, svdm_version, CMD_ENTER_MODE);
-	header |= VDO_OPOS(altmode->mode);
-
-	tcpm_queue_vdm_unlocked(port, header, vdo, vdo ? 1 : 0);
-	return 0;
-}
-
-static int tcpm_altmode_exit(struct typec_altmode *altmode)
-{
-	struct tcpm_port *port = typec_altmode_get_drvdata(altmode);
-	int svdm_version;
-	u32 header;
-
-	svdm_version = typec_get_negotiated_svdm_version(port->typec_port);
-	if (svdm_version < 0)
-		return svdm_version;
-
-	header = VDO(altmode->svid, 1, svdm_version, CMD_EXIT_MODE);
-	header |= VDO_OPOS(altmode->mode);
-
-	tcpm_queue_vdm_unlocked(port, header, NULL, 0);
-	return 0;
-}
-
-static int tcpm_altmode_vdm(struct typec_altmode *altmode,
-			    u32 header, const u32 *data, int count)
-{
-	struct tcpm_port *port = typec_altmode_get_drvdata(altmode);
-
-	tcpm_queue_vdm_unlocked(port, header, data, count - 1);
-
-	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
Signature · 1 line
heikki
#2 lore raw
Quoted 9 lines · Heikki Krogerus
Quoted 8 lines · Zhen Lei

Fixes the following W=1 kernel build warning:

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

The reference to the variable 'tcpm_altmode_ops' is deleted by the commit a079973f462a ("usb: typec: tcpm: Remove tcpc_config configuration mechanism").

Quoted 8 lines
Quoted 5 lines

By the way, the static functions referenced only by the variable 'tcpm_altmode_ops' are deleted accordingly.

Oh, I thought this was already fixed. Should this go into the stable trees as well?

We do not build kernels by default with "W=1" yet, so it's not needed in stable kernels.

thanks,

greg k-h

maintainer
#3 lore raw
Quoted 13 lines · Greg Kroah-Hartman
Quoted 12 lines · Heikki Krogerus
Quoted 11 lines · Zhen Lei

Fixes the following W=1 kernel build warning:

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

The reference to the variable 'tcpm_altmode_ops' is deleted by the commit a079973f462a ("usb: typec: tcpm: Remove tcpc_config configuration mechanism").

By the way, the static functions referenced only by the variable 'tcpm_altmode_ops' are deleted accordingly.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Oh, I thought this was already fixed. Should this go into the stable trees as well?

We do not build kernels by default with "W=1" yet, so it's not needed in stable kernels.

Okay, got it.

thanks,

Signature · 1 line
heikki
Reviewed-by
#4 lore raw
In reply to Heikki Krogerus
Quoted 9 lines · Heikki Krogerus
Quoted 8 lines · Zhen Lei

Fixes the following W=1 kernel build warning:

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

The reference to the variable 'tcpm_altmode_ops' is deleted by the commit a079973f462a ("usb: typec: tcpm: Remove tcpc_config configuration mechanism").

Quoted 9 lines
Quoted 5 lines

By the way, the static functions referenced only by the variable 'tcpm_altmode_ops' are deleted accordingly.

Oh, I thought this was already fixed. Should this go into the stable trees as well?

I thought there was some code supposed to be coming which would make use of it, but my memory may defeat me. Either case, it is getting old. It it is ever needed, it can be reintroduced.

Guenter

Quoted 95 lines
Quoted 92 lines
---
 drivers/usb/typec/tcpm/tcpm.c | 60 -------------------------------------------
 1 file changed, 60 deletions(-)
drivers/usb/typec/tcpm/tcpm.c +0 -60
index ce7af398c7c1c1f..2f89bae29c0c297 100644
@@ -1365,14 +1365,6 @@ static void tcpm_queue_vdm(struct tcpm_port *port, const u32 header,
 	mod_vdm_delayed_work(port, 0);
 }
 
-static void tcpm_queue_vdm_unlocked(struct tcpm_port *port, const u32 header,
-				    const u32 *data, int cnt)
-{
-	mutex_lock(&port->lock);
-	tcpm_queue_vdm(port, header, data, cnt);
-	mutex_unlock(&port->lock);
-}
-
 static void svdm_consume_identity(struct tcpm_port *port, const u32 *p, int cnt)
 {
 	u32 vdo = p[VDO_INDEX_IDH];
@@ -1705,8 +1697,6 @@ static void tcpm_handle_vdm_request(struct tcpm_port *port,
 	 *
 	 * And we also have this ordering:
 	 * 1. alt-mode driver takes the alt-mode's lock
-	 * 2. alt-mode driver calls tcpm_altmode_enter which takes the
-	 *    tcpm port lock
 	 *
 	 * Dropping our lock here avoids this.
 	 */
@@ -2060,56 +2050,6 @@ static int tcpm_validate_caps(struct tcpm_port *port, const u32 *pdo,
 	return 0;
 }
 
-static int tcpm_altmode_enter(struct typec_altmode *altmode, u32 *vdo)
-{
-	struct tcpm_port *port = typec_altmode_get_drvdata(altmode);
-	int svdm_version;
-	u32 header;
-
-	svdm_version = typec_get_negotiated_svdm_version(port->typec_port);
-	if (svdm_version < 0)
-		return svdm_version;
-
-	header = VDO(altmode->svid, vdo ? 2 : 1, svdm_version, CMD_ENTER_MODE);
-	header |= VDO_OPOS(altmode->mode);
-
-	tcpm_queue_vdm_unlocked(port, header, vdo, vdo ? 1 : 0);
-	return 0;
-}
-
-static int tcpm_altmode_exit(struct typec_altmode *altmode)
-{
-	struct tcpm_port *port = typec_altmode_get_drvdata(altmode);
-	int svdm_version;
-	u32 header;
-
-	svdm_version = typec_get_negotiated_svdm_version(port->typec_port);
-	if (svdm_version < 0)
-		return svdm_version;
-
-	header = VDO(altmode->svid, 1, svdm_version, CMD_EXIT_MODE);
-	header |= VDO_OPOS(altmode->mode);
-
-	tcpm_queue_vdm_unlocked(port, header, NULL, 0);
-	return 0;
-}
-
-static int tcpm_altmode_vdm(struct typec_altmode *altmode,
-			    u32 header, const u32 *data, int count)
-{
-	struct tcpm_port *port = typec_altmode_get_drvdata(altmode);
-
-	tcpm_queue_vdm_unlocked(port, header, data, count - 1);
-
-	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
#5 lore raw

Hi,

Quoted 16 lines · Guenter Roeck
Quoted 15 lines · Heikki Krogerus
Quoted 13 lines · Zhen Lei

Fixes the following W=1 kernel build warning:

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

The reference to the variable 'tcpm_altmode_ops' is deleted by the commit a079973f462a ("usb: typec: tcpm: Remove tcpc_config configuration mechanism").

By the way, the static functions referenced only by the variable 'tcpm_altmode_ops' are deleted accordingly.

Quoted 6 lines
Quoted 3 lines

Oh, I thought this was already fixed. Should this go into the stable trees as well?

I thought there was some code supposed to be coming which would make use of it, but my memory may defeat me.

There is code coming which uses this; and this is necessary to make DP altmode work on some devices.

I have dropped the ball a bit on posting a v2 of my series using this.

I'll prepare a v2 of my series, addressing Heikki's review comments to my v1 right away. I'll post a v2 at the latest tomorrow.

This is something which is on my TODO list anyways and this way we will save some churn with these functions going away only to be re-introduced again relatively soon after they were removed.

Regards,

Hans

Quoted 104 lines

Either case, it is getting old. It it is ever needed, it can be reintroduced.

Guenter

Quoted 95 lines
Quoted 92 lines
---
 drivers/usb/typec/tcpm/tcpm.c | 60 -------------------------------------------
 1 file changed, 60 deletions(-)
drivers/usb/typec/tcpm/tcpm.c +0 -60
index ce7af398c7c1c1f..2f89bae29c0c297 100644
@@ -1365,14 +1365,6 @@ static void tcpm_queue_vdm(struct tcpm_port *port, const u32 header,
 	mod_vdm_delayed_work(port, 0);
 }
 
-static void tcpm_queue_vdm_unlocked(struct tcpm_port *port, const u32 header,
-				    const u32 *data, int cnt)
-{
-	mutex_lock(&port->lock);
-	tcpm_queue_vdm(port, header, data, cnt);
-	mutex_unlock(&port->lock);
-}
-
 static void svdm_consume_identity(struct tcpm_port *port, const u32 *p, int cnt)
 {
 	u32 vdo = p[VDO_INDEX_IDH];
@@ -1705,8 +1697,6 @@ static void tcpm_handle_vdm_request(struct tcpm_port *port,
 	 *
 	 * And we also have this ordering:
 	 * 1. alt-mode driver takes the alt-mode's lock
-	 * 2. alt-mode driver calls tcpm_altmode_enter which takes the
-	 *    tcpm port lock
 	 *
 	 * Dropping our lock here avoids this.
 	 */
@@ -2060,56 +2050,6 @@ static int tcpm_validate_caps(struct tcpm_port *port, const u32 *pdo,
 	return 0;
 }
 
-static int tcpm_altmode_enter(struct typec_altmode *altmode, u32 *vdo)
-{
-	struct tcpm_port *port = typec_altmode_get_drvdata(altmode);
-	int svdm_version;
-	u32 header;
-
-	svdm_version = typec_get_negotiated_svdm_version(port->typec_port);
-	if (svdm_version < 0)
-		return svdm_version;
-
-	header = VDO(altmode->svid, vdo ? 2 : 1, svdm_version, CMD_ENTER_MODE);
-	header |= VDO_OPOS(altmode->mode);
-
-	tcpm_queue_vdm_unlocked(port, header, vdo, vdo ? 1 : 0);
-	return 0;
-}
-
-static int tcpm_altmode_exit(struct typec_altmode *altmode)
-{
-	struct tcpm_port *port = typec_altmode_get_drvdata(altmode);
-	int svdm_version;
-	u32 header;
-
-	svdm_version = typec_get_negotiated_svdm_version(port->typec_port);
-	if (svdm_version < 0)
-		return svdm_version;
-
-	header = VDO(altmode->svid, 1, svdm_version, CMD_EXIT_MODE);
-	header |= VDO_OPOS(altmode->mode);
-
-	tcpm_queue_vdm_unlocked(port, header, NULL, 0);
-	return 0;
-}
-
-static int tcpm_altmode_vdm(struct typec_altmode *altmode,
-			    u32 header, const u32 *data, int count)
-{
-	struct tcpm_port *port = typec_altmode_get_drvdata(altmode);
-
-	tcpm_queue_vdm_unlocked(port, header, data, count - 1);
-
-	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
maintainer
#6 lore raw
Quoted 29 lines · Hans de Goede

Hi,

Quoted 16 lines · Guenter Roeck
Quoted 15 lines · Heikki Krogerus
Quoted 13 lines · Zhen Lei

Fixes the following W=1 kernel build warning:

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

The reference to the variable 'tcpm_altmode_ops' is deleted by the commit a079973f462a ("usb: typec: tcpm: Remove tcpc_config configuration mechanism").

By the way, the static functions referenced only by the variable 'tcpm_altmode_ops' are deleted accordingly.

Quoted 6 lines
Quoted 3 lines

Oh, I thought this was already fixed. Should this go into the stable trees as well?

I thought there was some code supposed to be coming which would make use of it, but my memory may defeat me.

There is code coming which uses this; and this is necessary to make DP altmode work on some devices.

Quoted 8 lines

I have dropped the ball a bit on posting a v2 of my series using this.

I'll prepare a v2 of my series, addressing Heikki's review comments to my v1 right away. I'll post a v2 at the latest tomorrow.

This is something which is on my TODO list anyways and this way we will save some churn with these functions going away only to be re-introduced again relatively soon after they were removed.

Cool. Greg, I think we can skip this patch then.

thanks,

Signature · 1 line
heikki
#7 lore raw
In reply to Zhen Lei

Hi,

Quoted 8 lines · Zhen Lei

Fixes the following W=1 kernel build warning:

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

The reference to the variable 'tcpm_altmode_ops' is deleted by the commit a079973f462a ("usb: typec: tcpm: Remove tcpc_config configuration mechanism").

Quoted 5 lines

By the way, the static functions referenced only by the variable 'tcpm_altmode_ops' are deleted accordingly.

I have a patch pending:

https://www.spinics.net/lists/linux-usb/msg197684.html

Which actually uses this. I really need to (and plan to) brush the dust of this one soon and submit a new version.

As such I would prefer for these ops to not get removed. But I guess I can always include a patch in my series reverting the removal...

Regards,

Hans

Quoted 90 lines
---
 drivers/usb/typec/tcpm/tcpm.c | 60 -------------------------------------------
 1 file changed, 60 deletions(-)
drivers/usb/typec/tcpm/tcpm.c +0 -60
index ce7af398c7c1c1f..2f89bae29c0c297 100644
@@ -1365,14 +1365,6 @@ static void tcpm_queue_vdm(struct tcpm_port *port, const u32 header,
 	mod_vdm_delayed_work(port, 0);
 }
 
-static void tcpm_queue_vdm_unlocked(struct tcpm_port *port, const u32 header,
-				    const u32 *data, int cnt)
-{
-	mutex_lock(&port->lock);
-	tcpm_queue_vdm(port, header, data, cnt);
-	mutex_unlock(&port->lock);
-}
-
 static void svdm_consume_identity(struct tcpm_port *port, const u32 *p, int cnt)
 {
 	u32 vdo = p[VDO_INDEX_IDH];
@@ -1705,8 +1697,6 @@ static void tcpm_handle_vdm_request(struct tcpm_port *port,
 	 *
 	 * And we also have this ordering:
 	 * 1. alt-mode driver takes the alt-mode's lock
-	 * 2. alt-mode driver calls tcpm_altmode_enter which takes the
-	 *    tcpm port lock
 	 *
 	 * Dropping our lock here avoids this.
 	 */
@@ -2060,56 +2050,6 @@ static int tcpm_validate_caps(struct tcpm_port *port, const u32 *pdo,
 	return 0;
 }
 
-static int tcpm_altmode_enter(struct typec_altmode *altmode, u32 *vdo)
-{
-	struct tcpm_port *port = typec_altmode_get_drvdata(altmode);
-	int svdm_version;
-	u32 header;
-
-	svdm_version = typec_get_negotiated_svdm_version(port->typec_port);
-	if (svdm_version < 0)
-		return svdm_version;
-
-	header = VDO(altmode->svid, vdo ? 2 : 1, svdm_version, CMD_ENTER_MODE);
-	header |= VDO_OPOS(altmode->mode);
-
-	tcpm_queue_vdm_unlocked(port, header, vdo, vdo ? 1 : 0);
-	return 0;
-}
-
-static int tcpm_altmode_exit(struct typec_altmode *altmode)
-{
-	struct tcpm_port *port = typec_altmode_get_drvdata(altmode);
-	int svdm_version;
-	u32 header;
-
-	svdm_version = typec_get_negotiated_svdm_version(port->typec_port);
-	if (svdm_version < 0)
-		return svdm_version;
-
-	header = VDO(altmode->svid, 1, svdm_version, CMD_EXIT_MODE);
-	header |= VDO_OPOS(altmode->mode);
-
-	tcpm_queue_vdm_unlocked(port, header, NULL, 0);
-	return 0;
-}
-
-static int tcpm_altmode_vdm(struct typec_altmode *altmode,
-			    u32 header, const u32 *data, int count)
-{
-	struct tcpm_port *port = typec_altmode_get_drvdata(altmode);
-
-	tcpm_queue_vdm_unlocked(port, header, data, count - 1);
-
-	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
  */
maintainer
#8 lore raw
Quoted 19 lines · Hans de Goede

Hi,

Quoted 8 lines · Zhen Lei

Fixes the following W=1 kernel build warning:

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

The reference to the variable 'tcpm_altmode_ops' is deleted by the commit a079973f462a ("usb: typec: tcpm: Remove tcpc_config configuration mechanism").

Quoted 5 lines

By the way, the static functions referenced only by the variable 'tcpm_altmode_ops' are deleted accordingly.

I have a patch pending:

Quoted 7 lines

https://www.spinics.net/lists/linux-usb/msg197684.html

Which actually uses this. I really need to (and plan to) brush the dust of this one soon and submit a new version.

As such I would prefer for these ops to not get removed. But I guess I can always include a patch in my series reverting the removal...

Well, can we then just leave the ops there? If we're going to re-introduce them back soon in any case, then why drop them in the first place.

thanks,

Signature · 1 line
heikki
#9 lore raw

Hi,

Quoted 25 lines · Heikki Krogerus
Quoted 24 lines · Hans de Goede

Hi,

Quoted 8 lines · Zhen Lei

Fixes the following W=1 kernel build warning:

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

The reference to the variable 'tcpm_altmode_ops' is deleted by the commit a079973f462a ("usb: typec: tcpm: Remove tcpc_config configuration mechanism").

Quoted 5 lines

By the way, the static functions referenced only by the variable 'tcpm_altmode_ops' are deleted accordingly.

I have a patch pending:

https://www.spinics.net/lists/linux-usb/msg197684.html

Which actually uses this. I really need to (and plan to) brush the dust of this one soon and submit a new version.

Quoted 6 lines
Quoted 2 lines

As such I would prefer for these ops to not get removed. But I guess I can always include a patch in my series reverting the removal...

Well, can we then just leave the ops there? If we're going to re-introduce them back soon in any case, then why drop them in the first place.

Yes I'm in favor of just leaving them in place too, sorry if that was not clear.

Regards,

Hans