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] [day] [month] [year] [list]
Date:   Mon, 7 Nov 2016 11:16:37 -0800
From:   John Youn <John.Youn@...opsys.com>
To:     Nicholas Mc Guire <hofrat@...dl.org>,
        John Youn <John.Youn@...opsys.com>
CC:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Felipe Balbi <balbi@...nel.org>
Subject: Re: [PATCH] usb: dwc2: gadget: simplify list handling

On 11/7/2016 11:06 AM, Nicholas Mc Guire wrote:
> The current code is effectively equivalent to list_first_entry_or_null()
> so simply switch and simplify the code.
> 
> Fixes: 9c39ddc60ee9 ("USB: s3c-hsotg: Fix stall condition processing")
> Signed-off-by: Nicholas Mc Guire <hofrat@...dl.org>
> ---
> Found by simple coccinelle scanner
> 
> Compile tested with: x86_64_defconfig + CONFIG_USB_DWC2=m,
> CONFIG_USB_DWC2_PERIPHERAL=y
> 
> Patch is against 4.9.0-rc2 (localversion-next is next-20161028)
> 
>  drivers/usb/dwc2/gadget.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
> index 24fbebc..9ac8ca0 100644
> --- a/drivers/usb/dwc2/gadget.c
> +++ b/drivers/usb/dwc2/gadget.c
> @@ -1099,10 +1099,8 @@ static int dwc2_hsotg_process_req_status(struct dwc2_hsotg *hsotg,
>   */
>  static struct dwc2_hsotg_req *get_ep_head(struct dwc2_hsotg_ep *hs_ep)
>  {
> -	if (list_empty(&hs_ep->queue))
> -		return NULL;
> -
> -	return list_first_entry(&hs_ep->queue, struct dwc2_hsotg_req, queue);
> +	return list_first_entry_or_null(&hs_ep->queue,
> +					struct dwc2_hsotg_req, queue);
>  }
>  
>  /**
> 


Hi,

The same is already queued in Felipe's testing/next.

Regards,
John

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ