Re: [PATCH] usb: fix unused variables warnings in usb/host

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 29 Nov 2010, Fabio Estevam wrote:

> Fix the following warnings:
> 
> drivers/usb/host/ehci-hub.c:109: warning: 'ehci_adjust_port_wakeup_flags' defined but not used
> drivers/usb/host/ehci-lpm.c:20: warning: 'ehci_lpm_set_da' defined but not used
> drivers/usb/host/ehci-lpm.c:40: warning: 'ehci_lpm_check' defined but not used
> drivers/usb/host/ehci-q.c:146: warning: 'ehci_clear_tt_buffer_complete' defined but not used
> drivers/usb/host/ehci-hcd.c:1101: warning: 'ehci_endpoint_reset' defined but not

NAK.  Some of these changes have already been posted and some of them 
are wrong.

> Signed-off-by: Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx>
> ---
>  drivers/usb/host/ehci-hcd.c |    2 +-
>  drivers/usb/host/ehci-hub.c |    2 +-
>  drivers/usb/host/ehci-lpm.c |    6 ++++--
>  drivers/usb/host/ehci-q.c   |    2 +-
>  4 files changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
> index e906280..4291888 100644
> --- a/drivers/usb/host/ehci-hcd.c
> +++ b/drivers/usb/host/ehci-hcd.c
> @@ -1097,7 +1097,7 @@ done:
>  	spin_unlock_irqrestore (&ehci->lock, flags);
>  }
>  
> -static void
> +static void __maybe_unused
>  ehci_endpoint_reset(struct usb_hcd *hcd, struct usb_host_endpoint *ep)
>  {
>  	struct ehci_hcd		*ehci = hcd_to_ehci(hcd);

This is wrong.  ehci_endpoint_reset() must not be unused.  The warning 
should be fixed by actually using the routine.

> diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
> index 796ea0c..f636caa 100644
> --- a/drivers/usb/host/ehci-hub.c
> +++ b/drivers/usb/host/ehci-hub.c
> @@ -106,7 +106,7 @@ static void ehci_handover_companion_ports(struct ehci_hcd *ehci)
>  	ehci->owned_ports = 0;
>  }
>  
> -static void ehci_adjust_port_wakeup_flags(struct ehci_hcd *ehci,
> +static void __maybe_unused ehci_adjust_port_wakeup_flags(struct ehci_hcd *ehci,
>  		bool suspending, bool do_wakeup)
>  {
>  	int		port;
> diff --git a/drivers/usb/host/ehci-lpm.c b/drivers/usb/host/ehci-lpm.c
> index b4d4d63..5d56ae9 100644
> --- a/drivers/usb/host/ehci-lpm.c
> +++ b/drivers/usb/host/ehci-lpm.c
> @@ -17,7 +17,8 @@
>  */
>  
>  /* this file is part of ehci-hcd.c */
> -static int ehci_lpm_set_da(struct ehci_hcd *ehci, int dev_addr, int port_num)
> +static int __maybe_unused
> +ehci_lpm_set_da(struct ehci_hcd *ehci, int dev_addr, int port_num)
>  {
>  	u32 __iomem portsc;
>  
> @@ -37,7 +38,8 @@ static int ehci_lpm_set_da(struct ehci_hcd *ehci, int dev_addr, int port_num)
>   * this function is used to check if the device support LPM
>   * if yes, mark the PORTSC register with PORT_LPM bit
>   */
> -static int ehci_lpm_check(struct ehci_hcd *ehci, int port)
> +static int __maybe_unused
> +ehci_lpm_check(struct ehci_hcd *ehci, int port)
>  {
>  	u32 __iomem	*portsc ;
>  	u32 val32;
> diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
> index 233c288..c9859c5 100644
> --- a/drivers/usb/host/ehci-q.c
> +++ b/drivers/usb/host/ehci-q.c
> @@ -143,7 +143,7 @@ qh_refresh (struct ehci_hcd *ehci, struct ehci_qh *qh)
>  
>  static void qh_link_async(struct ehci_hcd *ehci, struct ehci_qh *qh);
>  
> -static void ehci_clear_tt_buffer_complete(struct usb_hcd *hcd,
> +static void __maybe_unused ehci_clear_tt_buffer_complete(struct usb_hcd *hcd,
>  		struct usb_host_endpoint *ep)
>  {
>  	struct ehci_hcd		*ehci = hcd_to_ehci(hcd);

This also is wrong; ehci_clear_tt_buffer_complete must not be unused.

Paul Mundt may be working on a fix for the endpoint_reset and 
clear_tt_buffer_complete issues.

Alan Stern


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux