linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: dwc2: Avoid leaving the error_debugfs label unused
@ 2020-10-17 16:50 Martin Blumenstingl
  2020-10-26  6:01 ` Minas Harutyunyan
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Blumenstingl @ 2020-10-17 16:50 UTC (permalink / raw)
  To: linux-usb, balbi, gregkh
  Cc: linux-kernel, hminas, axboe, Martin Blumenstingl, kernel test robot

The error_debugfs label is only used when either
CONFIG_USB_DWC2_PERIPHERAL or CONFIG_USB_DWC2_DUAL_ROLE is enabled. Add
the same #if to the error_debugfs label itself as the code which uses
this label already has.

This avoids the following compiler warning:
  warning: label ‘error_debugfs’ defined but not used [-Wunused-label]

Fixes: e1c08cf23172ed ("usb: dwc2: Add missing cleanups when usb_add_gadget_udc() fails")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 drivers/usb/dwc2/platform.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
index e2820676beb1..5f18acac7406 100644
--- a/drivers/usb/dwc2/platform.c
+++ b/drivers/usb/dwc2/platform.c
@@ -608,10 +608,13 @@ static int dwc2_driver_probe(struct platform_device *dev)
 #endif /* CONFIG_USB_DWC2_PERIPHERAL || CONFIG_USB_DWC2_DUAL_ROLE */
 	return 0;
 
+#if IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL) || \
+	IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE)
 error_debugfs:
 	dwc2_debugfs_exit(hsotg);
 	if (hsotg->hcd_enabled)
 		dwc2_hcd_remove(hsotg);
+#endif
 error_drd:
 	dwc2_drd_exit(hsotg);
 
-- 
2.28.0


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

* Re: [PATCH] usb: dwc2: Avoid leaving the error_debugfs label unused
  2020-10-17 16:50 [PATCH] usb: dwc2: Avoid leaving the error_debugfs label unused Martin Blumenstingl
@ 2020-10-26  6:01 ` Minas Harutyunyan
  0 siblings, 0 replies; 2+ messages in thread
From: Minas Harutyunyan @ 2020-10-26  6:01 UTC (permalink / raw)
  To: Martin Blumenstingl, linux-usb, balbi, gregkh
  Cc: linux-kernel, axboe, kernel test robot

On 10/17/2020 8:50 PM, Martin Blumenstingl wrote:
> The error_debugfs label is only used when either
> CONFIG_USB_DWC2_PERIPHERAL or CONFIG_USB_DWC2_DUAL_ROLE is enabled. Add
> the same #if to the error_debugfs label itself as the code which uses
> this label already has.
> 
> This avoids the following compiler warning:
>    warning: label ‘error_debugfs’ defined but not used [-Wunused-label]
> 
> Fixes: e1c08cf23172ed ("usb: dwc2: Add missing cleanups when usb_add_gadget_udc() fails")
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Jens Axboe <axboe@kernel.dk>
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---
>   drivers/usb/dwc2/platform.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
> index e2820676beb1..5f18acac7406 100644
> --- a/drivers/usb/dwc2/platform.c
> +++ b/drivers/usb/dwc2/platform.c
> @@ -608,10 +608,13 @@ static int dwc2_driver_probe(struct platform_device *dev)
>   #endif /* CONFIG_USB_DWC2_PERIPHERAL || CONFIG_USB_DWC2_DUAL_ROLE */
>   	return 0;
>   
> +#if IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL) || \
> +	IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE)
>   error_debugfs:
>   	dwc2_debugfs_exit(hsotg);
>   	if (hsotg->hcd_enabled)
>   		dwc2_hcd_remove(hsotg);
> +#endif
>   error_drd:
>   	dwc2_drd_exit(hsotg);
>   
> 
Acked-by: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>


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

end of thread, other threads:[~2020-10-26  6:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-17 16:50 [PATCH] usb: dwc2: Avoid leaving the error_debugfs label unused Martin Blumenstingl
2020-10-26  6:01 ` Minas Harutyunyan

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