linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] usb: typec: Remove set but not used variable
@ 2020-09-24 14:12 Li Heng
  2020-09-24 14:33 ` Guenter Roeck
  0 siblings, 1 reply; 3+ messages in thread
From: Li Heng @ 2020-09-24 14:12 UTC (permalink / raw)
  To: linux, heikki.krogerus; +Cc: gregkh, linux-usb, linux-kernel

Fixes gcc '-Wunused-but-set-variable' warning:

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

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Li Heng <liheng40@huawei.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 9280654..1542eaa 100644
--- a/drivers/usb/typec/tcpm/tcpm.c
+++ b/drivers/usb/typec/tcpm/tcpm.c
@@ -1617,12 +1617,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
  */
--
2.7.4


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

* Re: [PATCH -next] usb: typec: Remove set but not used variable
  2020-09-24 14:12 [PATCH -next] usb: typec: Remove set but not used variable Li Heng
@ 2020-09-24 14:33 ` Guenter Roeck
  2020-09-25 12:21   ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Guenter Roeck @ 2020-09-24 14:33 UTC (permalink / raw)
  To: Li Heng, heikki.krogerus; +Cc: gregkh, linux-usb, linux-kernel

On 9/24/20 7:12 AM, Li Heng wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/usb/typec/tcpm/tcpm.c:1620:39: warning:
> ‘tcpm_altmode_ops’ defined but not used [-Wunused-const-variable=]
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Li Heng <liheng40@huawei.com>

I thought there was a patch series underway which started using it,
but maybe my memory defeats me. Either case, it doesn't make much sense
to remove the ops variable without removing the associated functions
as well.

Guenter

> ---
>  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 9280654..1542eaa 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -1617,12 +1617,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
>   */
> --
> 2.7.4
> 



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

* Re: [PATCH -next] usb: typec: Remove set but not used variable
  2020-09-24 14:33 ` Guenter Roeck
@ 2020-09-25 12:21   ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2020-09-25 12:21 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: Li Heng, heikki.krogerus, linux-usb, linux-kernel

On Thu, Sep 24, 2020 at 07:33:59AM -0700, Guenter Roeck wrote:
> On 9/24/20 7:12 AM, Li Heng wrote:
> > Fixes gcc '-Wunused-but-set-variable' warning:
> > 
> > drivers/usb/typec/tcpm/tcpm.c:1620:39: warning:
> > ‘tcpm_altmode_ops’ defined but not used [-Wunused-const-variable=]
> > 
> > Reported-by: Hulk Robot <hulkci@huawei.com>
> > Signed-off-by: Li Heng <liheng40@huawei.com>
> 
> I thought there was a patch series underway which started using it,
> but maybe my memory defeats me. Either case, it doesn't make much sense
> to remove the ops variable without removing the associated functions
> as well.

I agree, if this isn't needed, then the functions here should also be
removed in the same patch.

thanks,

greg k-h

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

end of thread, other threads:[~2020-09-25 12:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-24 14:12 [PATCH -next] usb: typec: Remove set but not used variable Li Heng
2020-09-24 14:33 ` Guenter Roeck
2020-09-25 12:21   ` Greg KH

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).