Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758743AbbFAGT7 (ORCPT ); Mon, 1 Jun 2015 02:19:59 -0400 Received: from mail-by2on0138.outbound.protection.outlook.com ([207.46.100.138]:21315 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752125AbbFAGTv convert rfc822-to-8bit (ORCPT ); Mon, 1 Jun 2015 02:19:51 -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: AQHQl6YjOcmv9iJfwkW31DPNv7r3cZ2VrOSAgAAFygCAAOgUgIAAhnsg Date: Mon, 1 Jun 2015 06:19:47 +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> In-Reply-To: <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;SN1PR0301MB1629;3:zWGWZQ5xpIn5cnmOLGVUIa7+SStiqbYcboNZUA9ate14b0V58cUKzVD1pA57ghcxPWnNaJw8e0UgjZMQ/Z2TirmFx9LLFqecs+UL9cCTPjnXLhxKyRFBDG9dvnCbhSyd+3zwP0HEXc5ZYOhH9m1Ubg==;10:7iBSppi1f/JBE8+kvYvsgEnxfAk9T17+K3YWerBt+xFdH/cKwcazkSuQoFXoCHYE3f4F7iDhViKJ1zCaYxr3lSMgYMbgcG+Xi5lLcs1ZlkQ=;6:GW1vPRhDV01sOoOxZQMd/6QCPoQ2/6UpX8lg83rDw6S5eRnzvKrYb6mDDreMYciS x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0301MB1629;UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0301MB1567; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(520003)(5005006)(3002001);SRVR:SN1PR0301MB1629;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0301MB1629; x-forefront-prvs: 05947791E4 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(13464003)(24454002)(199003)(377454003)(377424004)(51704005)(189002)(46102003)(122556002)(40100003)(93886004)(50986999)(2900100001)(92566002)(68736005)(2950100001)(102836002)(77096005)(77156002)(62966003)(19580405001)(19580395003)(86362001)(101416001)(54356999)(74316001)(76576001)(76176999)(110136002)(2656002)(87936001)(66066001)(64706001)(189998001)(5002640100001)(97736004)(4001540100001)(5001960100002)(33656002)(105586002)(5001830100001)(5001860100001)(99286002)(81156007)(106356001)(106116001);DIR:OUT;SFP:1102;SCL:1;SRVR:SN1PR0301MB1629;H:SN1PR0301MB1629.namprd03.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Jun 2015 06:19:47.0490 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0301MB1629 X-Microsoft-Exchange-Diagnostics: 1;SN1PR0301MB1567;2:iReL8irJGpNLDHrV6gHs4iCWwN65UiqSFiZ4ZcCmwlcCZTOJXyiBM0vQTmxBQP8J;2:oUOBxjOBYhhvC1FLW9JgbKSmy4Is5TYTg8KKOb3M9hvB2Pqf3M/K6WVBSxhlPlBOjaPnnx4TGNi+V9IAeoBlhyBeVETPAxP/PrJ5rj1i2Yt5fZ/pAHJ6J0RRJcwicLVNnXhiOUUlKXu4uP9HQ5GhoQ==;9:qQ+WTXkyO0krLStnwWOadaylULJ1uG2SzwWSQndHVLKIhrN/8K1BBdDiJxS/ijPXj4svJ8rZ1ejIP2Y5ih5SAYz5zbRIZytMgsc3POabjAeaNB6+LAxQs9H+5xbI0+bInmnKvqrV7rs3E4u6xBpQpg== X-OriginatorOrg: freescale.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2636 Lines: 65 > -----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. -- 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/