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: <20141009081520.GJ1990@localhost>
Date:	Thu, 9 Oct 2014 10:15:20 +0200
From:	Johan Hovold <johan@...nel.org>
To:	Lee Jones <lee.jones@...aro.org>
Cc:	Muthu Mani <muth@...ress.com>,
	Samuel Ortiz <sameo@...ux.intel.com>,
	Wolfram Sang <wsa@...-dreams.de>,
	Linus Walleij <linus.walleij@...aro.org>,
	Alexandre Courbot <gnurou@...il.com>,
	gregkh@...uxfoundation.org, linux-i2c@...r.kernel.org,
	linux-gpio@...r.kernel.org, linux-usb@...r.kernel.org,
	linux-kernel@...r.kernel.org, Rajaram Regupathy <rera@...ress.com>,
	Johan Hovold <johan@...nel.org>
Subject: Re: [PATCH v3 1/3] mfd: add support for Cypress CYUSBS234 USB Serial
 Bridge controller

On Thu, Oct 09, 2014 at 08:40:29AM +0100, Lee Jones wrote:
> On Mon, 06 Oct 2014, Muthu Mani wrote:

> > +static int update_ep_details(struct usb_interface *interface,
> > +				struct cyusbs23x *cyusbs)
> > +{
> > +	struct usb_host_interface *iface_desc;
> > +	struct usb_endpoint_descriptor *ep;
> > +	int i;
> > +
> > +	iface_desc = interface->cur_altsetting;
> > +
> > +	for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
> > +
> > +		ep = &iface_desc->endpoint[i].desc;
> > +
> > +		if (!cyusbs->bulk_in_ep_num && usb_endpoint_is_bulk_in(ep))
> > +			cyusbs->bulk_in_ep_num = ep->bEndpointAddress;
> > +		if (!cyusbs->bulk_out_ep_num && usb_endpoint_is_bulk_out(ep))
> > +			cyusbs->bulk_out_ep_num = ep->bEndpointAddress;
> > +		if (!cyusbs->intr_in_ep_num && usb_endpoint_is_int_in(ep))
> > +			cyusbs->intr_in_ep_num = ep->bEndpointAddress;
> > +	}
> 
> All of the USB specific code in this driver will require a USB Ack.

I'll review it once the incomplete gpio-driver issue has been resolved.

> > +	dev_dbg(&interface->dev, "%s intr_in=%d, bulk_in=%d, bulk_out=%d\n",
> > +		__func__, cyusbs->intr_in_ep_num ,
> > +		cyusbs->bulk_in_ep_num, cyusbs->bulk_out_ep_num);
> > +
> > +	if (!cyusbs->bulk_in_ep_num || !cyusbs->bulk_out_ep_num ||
> > +		!cyusbs->intr_in_ep_num)
> > +		return -ENODEV;
> > +
> > +	return 0;
> > +}

[...]

> > diff --git a/include/linux/mfd/cyusbs23x.h b/include/linux/mfd/cyusbs23x.h

> > +/* Serial interfaces (I2C, SPI, UART) differ in interface subclass */
> > +enum cy_scb_modes {
> > +	CY_USBS_SCB_DISABLED = 0,
> > +	CY_USBS_SCB_UART = 1,
> > +	CY_USBS_SCB_SPI = 2,
> > +	CY_USBS_SCB_I2C = 3
> 
> No need to number these.

As it's not an arbitrary enumeration, I think they should be initialised
explicitly. They could be defined in the mfd driver though, as they only
appear to be needed during probe.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ