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: <20150804160948.GJ23659@saruman.tx.rr.com>
Date:	Tue, 4 Aug 2015 11:09:48 -0500
From:	Felipe Balbi <balbi@...com>
To:	Robert Baldyga <r.baldyga@...sung.com>
CC:	<balbi@...com>, <gregkh@...uxfoundation.org>,
	<Peter.Chen@...escale.com>, <johnyoun@...opsys.com>,
	<dahlmann.thomas@...or.de>, <nicolas.ferre@...el.com>,
	<cernekee@...il.com>, <leoli@...escale.com>, <daniel@...que.org>,
	<haojian.zhuang@...il.com>, <robert.jarzmik@...e.fr>,
	<michal.simek@...inx.com>, <devel@...verdev.osuosl.org>,
	<linux-kernel@...r.kernel.org>, <linux-usb@...r.kernel.org>,
	<linux-omap@...r.kernel.org>, <linux-geode@...ts.infradead.org>,
	<linux-arm-kernel@...ts.infradead.org>,
	<linuxppc-dev@...ts.ozlabs.org>, <andrzej.p@...sung.com>,
	<m.szyprowski@...sung.com>, <stern@...land.harvard.edu>,
	<petr.cvek@....cz>
Subject: Re: [PATCH v5 07/46] usb: dwc3: gadget: add ep capabilities support

On Fri, Jul 31, 2015 at 04:00:19PM +0200, Robert Baldyga wrote:
> Convert endpoint configuration to new capabilities model.
> 
> Signed-off-by: Robert Baldyga <r.baldyga@...sung.com>
> ---
>  drivers/usb/dwc3/gadget.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> index 2feed9e..bd4c3db 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -1715,6 +1715,19 @@ static int dwc3_gadget_init_hw_endpoints(struct dwc3 *dwc,
>  				return ret;
>  		}
>  
> +		if (epnum == 0 || epnum == 1) {
> +			dep->endpoint.caps.type_control = true;
> +		} else {
> +			dep->endpoint.caps.type_iso = true;
> +			dep->endpoint.caps.type_bulk = true;
> +			dep->endpoint.caps.type_int = true;
> +		}
> +
> +		if (direction)
> +			dep->endpoint.caps.dir_in = true;
> +		else
> +			dep->endpoint.caps.dir_out = true;

you can avoid the branch for the direction:

		dep->endpoint.caps.dir_in = !!direction;
		dep->endpoint.caps.dir_out = !direction;

-- 
balbi

Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ