From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758234AbbEaHLe (ORCPT ); Sun, 31 May 2015 03:11:34 -0400 Received: from smtprelay0148.hostedemail.com ([216.40.44.148]:53553 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758211AbbEaHLW (ORCPT ); Sun, 31 May 2015 03:11:22 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::,RULES_HIT:41:355:379:541:599:800:960:966:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3871:3873:3874:4250:4321:4385:5007:6261:7903:7904:10004:10400:10848:11026:11232:11473:11658:11914:12438:12517:12519:12740:13019:13069:13161:13229:13311:13357:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: rain69_28a7dc6c39111 X-Filterd-Recvd-Size: 2119 Message-ID: <1433056278.2984.16.camel@perches.com> Subject: Re: [PATCH 3/5] drivers:usb:fsl: Replace macros with enumerated type From: Joe Perches To: Greg KH Cc: Nikhil Badola , linux-kernel@vger.kernel.org, stern@rowland.harvard.edu, linux-usb@vger.kernel.org Date: Sun, 31 May 2015 00:11:18 -0700 In-Reply-To: <20150531065035.GB17795@kroah.com> References: <1432640748-18657-1-git-send-email-nikhil.badola@freescale.com> <20150531065035.GB17795@kroah.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > > Also, I don't think the C standard forces the non-numberd 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.