linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: typec: tcpm: remove useless variable
@ 2021-04-09  9:22 Jiapeng Chong
  2021-04-09  9:35 ` Heikki Krogerus
  0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Chong @ 2021-04-09  9:22 UTC (permalink / raw)
  To: linux; +Cc: heikki.krogerus, gregkh, linux-usb, linux-kernel, 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=].

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/usb/typec/tcpm/tcpm.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
index ce7af39..4585785 100644
--- a/drivers/usb/typec/tcpm/tcpm.c
+++ b/drivers/usb/typec/tcpm/tcpm.c
@@ -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
  */
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] usb: typec: tcpm: remove useless variable
  2021-04-09  9:22 [PATCH] usb: typec: tcpm: remove useless variable Jiapeng Chong
@ 2021-04-09  9:35 ` Heikki Krogerus
  0 siblings, 0 replies; 2+ messages in thread
From: Heikki Krogerus @ 2021-04-09  9:35 UTC (permalink / raw)
  To: Jiapeng Chong; +Cc: linux, gregkh, linux-usb, linux-kernel

On Fri, Apr 09, 2021 at 05:22:16PM +0800, Jiapeng Chong wrote:
> Fix the following gcc warning:
> 
> drivers/usb/typec/tcpm/tcpm.c:2107:39: warning: ‘tcpm_altmode_ops’
> defined but not used [-Wunused-const-variable=].
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/usb/typec/tcpm/tcpm.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index ce7af39..4585785 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -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,

-- 
heikki

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-09  9:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-09  9:22 [PATCH] usb: typec: tcpm: remove useless variable Jiapeng Chong
2021-04-09  9:35 ` Heikki Krogerus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).