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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200703072926.GA2322133@kroah.com>
Date:   Fri, 3 Jul 2020 09:29:26 +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, Minas Harutyunyan <hminas@...opsys.com>,
        Ben Dooks <ben@...tec.co.uk>
Subject: Re: [PATCH 11/30] usb: dwc2: gadget: Avoid pointless read of EP
 control register

On Thu, Jul 02, 2020 at 03:46:06PM +0100, Lee Jones wrote:
> Commit ec1f9d9f01384 ("usb: dwc2: gadget: parity fix in isochronous mode") moved
> these checks to dwc2_hsotg_change_ep_iso_parity() back in 2015.  The assigned
> value hasn't been read back since.  Let's remove the unnecessary H/W read.
> 
> Fixes the following W=1 warning:
> 
>  drivers/usb/dwc2/gadget.c: In function ‘dwc2_hsotg_epint’:
>  drivers/usb/dwc2/gadget.c:2981:6: warning: variable ‘ctrl’ set but not used [-Wunused-but-set-variable]
>  2981 | u32 ctrl;
>  | ^~~~
> 
> Cc: Minas Harutyunyan <hminas@...opsys.com>
> Cc: Ben Dooks <ben@...tec.co.uk>
> Signed-off-by: Lee Jones <lee.jones@...aro.org>
> ---
>  drivers/usb/dwc2/gadget.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
> index 116e6175c7a48..fa07e3fcb8841 100644
> --- a/drivers/usb/dwc2/gadget.c
> +++ b/drivers/usb/dwc2/gadget.c
> @@ -2975,10 +2975,8 @@ static void dwc2_hsotg_epint(struct dwc2_hsotg *hsotg, unsigned int idx,
>  	u32 epctl_reg = dir_in ? DIEPCTL(idx) : DOEPCTL(idx);
>  	u32 epsiz_reg = dir_in ? DIEPTSIZ(idx) : DOEPTSIZ(idx);
>  	u32 ints;
> -	u32 ctrl;
>  
>  	ints = dwc2_gadget_read_ep_interrupts(hsotg, idx, dir_in);
> -	ctrl = dwc2_readl(hsotg, epctl_reg);

As you know, lots of hardware requires reads to happen to do things, so
are you sure it is safe to remove this read call?

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ