lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 3 Jul 2020 09:36:35 +0200
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Lee Jones <lee.jones@...aro.org>
Cc:     linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-usb@...r.kernel.org,
        Masahiro Yamada <yamada.masahiro@...ionext.com>,
        Rodolfo Giometti <giometti@...ux.it>,
        "Eurotech S.p.A" <info@...tech.it>
Subject: Re: [PATCH 23/30] usb: host: oxu210hp-hcd: Move declaration of 'qtd'
 into 'ifdef OXU_URB_TRACE'

On Thu, Jul 02, 2020 at 03:46:18PM +0100, Lee Jones wrote:
> If we assign 'epnum' during the declaration we can also avoid "ISO
> C90 forbids mixed declarations" issues.  So it does looks like we
> can have our cake and eat it in this scenario.
> 
> Fixes the following W=1 kernel build warning(s):
> 
>  drivers/usb/host/oxu210hp-hcd.c: In function ‘submit_async’:
>  drivers/usb/host/oxu210hp-hcd.c:2040:19: warning: variable ‘qtd’ set but not used [-Wunused-but-set-variable]
>  2040 | struct ehci_qtd *qtd;
>  | ^~~
> 
> Cc: Masahiro Yamada <yamada.masahiro@...ionext.com>
> Cc: Rodolfo Giometti <giometti@...ux.it>
> Cc: "Eurotech S.p.A" <info@...tech.it>
> Signed-off-by: Lee Jones <lee.jones@...aro.org>
> ---
>  drivers/usb/host/oxu210hp-hcd.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c
> index 120666a0d5901..b00673295c9fe 100644
> --- a/drivers/usb/host/oxu210hp-hcd.c
> +++ b/drivers/usb/host/oxu210hp-hcd.c
> @@ -2037,16 +2037,15 @@ static struct ehci_qh *qh_append_tds(struct oxu_hcd *oxu,
>  static int submit_async(struct oxu_hcd	*oxu, struct urb *urb,
>  			struct list_head *qtd_list, gfp_t mem_flags)
>  {
> -	struct ehci_qtd	*qtd;
> -	int epnum;
> +	int epnum = urb->ep->desc.bEndpointAddress;
>  	unsigned long flags;
>  	struct ehci_qh *qh = NULL;
>  	int rc = 0;
> +#ifdef OXU_URB_TRACE
> +	struct ehci_qtd	*qtd;
>  
>  	qtd = list_entry(qtd_list->next, struct ehci_qtd, qtd_list);
> -	epnum = urb->ep->desc.bEndpointAddress;
>  
> -#ifdef OXU_URB_TRACE
>  	oxu_dbg(oxu, "%s %s urb %p ep%d%s len %d, qtd %p [qh %p]\n",
>  		__func__, urb->dev->devpath, urb,
>  		epnum & 0x0f, (epnum & USB_DIR_IN) ? "in" : "out",
> -- 
> 2.25.1
> 

Ugh, nice hack, but those OXU_URB_TRACE defines really just need to be
dropped entirely.  I'll take this for now though, thanks.

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ