Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751561AbbFDEFd (ORCPT ); Thu, 4 Jun 2015 00:05:33 -0400 Received: from mail-bn1on0130.outbound.protection.outlook.com ([157.56.110.130]:44283 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750769AbbFDEFX convert rfc822-to-8bit (ORCPT ); Thu, 4 Jun 2015 00:05:23 -0400 From: Badola Nikhil To: Greg KH CC: "linux-kernel@vger.kernel.org" , "stern@rowland.harvard.edu" , "linux-usb@vger.kernel.org" , Joe Perches Subject: RE: [PATCH 3/5] drivers:usb:fsl: Replace macros with enumerated type Thread-Topic: [PATCH 3/5] drivers:usb:fsl: Replace macros with enumerated type Thread-Index: AQHQl6YjOcmv9iJfwkW31DPNv7r3cZ2VrOSAgAAFygCAAOgUgIAAhnsggASkdjA= Date: Thu, 4 Jun 2015 04:05:19 +0000 Message-ID: References: <1432640748-18657-1-git-send-email-nikhil.badola@freescale.com> <20150531065035.GB17795@kroah.com> <1433056278.2984.16.camel@perches.com> <20150531210157.GA4007@kroah.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=nikhil.badola@freescale.com; x-originating-ip: [192.88.169.1] x-microsoft-exchange-diagnostics: 1;SN1PR0301MB1630;3:4LD6Ef84TKOwsOn1626kGCFA7J+YG1p3C9i9op5llgAtShPH2qcJO/omHvtfDm7c7w5kSfY27gIavjbDVRa1xzaUQzrxTj4BDDU5JeZ3GrcndZmJ3H1ry0krGdipvDfY32MtIocJhj8I8SaBL7lo4A==;10:JnPDcDQoKiBzv3eZLP9JS2DXg8T7iJgcMbu9TZsZP1jikgpzhUfVOhdGOVitG9Ftv0+mxmX9n2rqbfmVx/E+pyLJk8gmnuYdScHII4lOvRg=;6:98MEyJejBy7SgtWAL/FOhVuDJp9mn6ahrVptomP7BHSgpxWMnEmqkrm3ukkzgcKo x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0301MB1630; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(5005006)(520003)(3002001);SRVR:SN1PR0301MB1630;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0301MB1630; x-forefront-prvs: 0597911EE1 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(189002)(51704005)(24454002)(13464003)(377424004)(199003)(377454003)(77096005)(2900100001)(5001960100002)(77156002)(62966003)(97736004)(189998001)(19580395003)(19580405001)(64706001)(5001860100001)(68736005)(46102003)(122556002)(5002640100001)(93886004)(5001830100001)(102836002)(4001540100001)(54356999)(110136002)(99286002)(105586002)(86362001)(87936001)(2656002)(101416001)(33656002)(40100003)(66066001)(92566002)(74316001)(106356001)(106116001)(76576001)(81156007)(50986999)(76176999);DIR:OUT;SFP:1102;SCL:1;SRVR:SN1PR0301MB1630;H:SN1PR0301MB1629.namprd03.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jun 2015 04:05:20.0073 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0301MB1630 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3280 Lines: 80 > -----Original Message----- > From: Badola Nikhil-B46172 > Sent: Monday, June 01, 2015 11:50 AM > To: 'Greg KH' > Cc: linux-kernel@vger.kernel.org; stern@rowland.harvard.edu; linux- > usb@vger.kernel.org; Joe Perches > Subject: RE: [PATCH 3/5] drivers:usb:fsl: Replace macros with enumerated > type > > > -----Original Message----- > > From: Greg KH [mailto:gregkh@linuxfoundation.org] > > Sent: Monday, June 01, 2015 2:32 AM > > To: Joe Perches > > Cc: Badola Nikhil-B46172; linux-kernel@vger.kernel.org; > > stern@rowland.harvard.edu; linux-usb@vger.kernel.org > > Subject: Re: [PATCH 3/5] drivers:usb:fsl: Replace macros with > > enumerated type > > > > On Sun, May 31, 2015 at 12:11:18AM -0700, Joe Perches wrote: > > > On Sun, 2015-05-31 at 15:50 +0900, Greg KH wrote: > > > > On Tue, May 26, 2015 at 05:15:48PM +0530, Nikhil Badola wrote: > > > > > Replace macros with enumerated type to represent usb ip > > > > > controller version > > > > > > > > > > Signed-off-by: Nikhil Badola > > > > > --- > > > > > include/linux/fsl_devices.h | 13 ++++++++----- > > > > > 1 file changed, 8 insertions(+), 5 deletions(-) > > > > > > > > > > diff --git a/include/linux/fsl_devices.h > > > > > b/include/linux/fsl_devices.h > > > [] > > > > > +enum fsl_usb2_controller_ver { > > > > > + FSL_USB_VER_OLD = 0, > > > > > + FSL_USB_VER_1_6, > > > > > + FSL_USB_VER_2_2, > > > > > + FSL_USB_VER_2_4, > > > > > + FSL_USB_VER_2_5, > > > > > +}; > > > > > > > > Don't you want to change that function that uses these to return > > > > the enumerated type and not an integer? > > > > > > I missed that. I will do this change in the next patch version. > > > > > Also, I don't think the C standard forces the non-numbered values > > > > to be sequential, > > > > > > Then you haven't read the standard in awhile and you likely forgot. > > > > > > 6.7.2.2 > > > If the first enumerator has no =, the value of its enumeration > > > constant is 0. Each subsequent enumerator with no = defines its > > > enumeration constant as the value of the constant expression > > > obtained by adding 1 to the value of the previous enumeration constant. > > > > Ah, you are right, I did forget. > > > > But if you are wanting to use the "numerical" value of these, please > > be explicit when defining it. Otherwise someone might think it was > > just fine to put a new entry in the middle of the list. > > > We are only relying on the controller version to be less (or greater) than a > specific version and we are not using exact "numerical" value. Refer > drivers/usb/host/ehci-fsl.c . > In addition, the enum entries defined are specific to controller version i.e 1.6, > 2.2, 2.4 and 2.5. > In future if anyone needs to add an entry; supposedly 2.6; he would do so as > per the sequence maintained. Is it fine by above explanation to keep value for only first entry as done in this patch? Should I move ahead with next patch version changing the return type to enum for function which is returning usb controller version? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/