public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Nikhil Badola <nikhil.badola@freescale.com>,
	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
Date: Sun, 31 May 2015 00:11:18 -0700	[thread overview]
Message-ID: <1433056278.2984.16.camel@perches.com> (raw)
In-Reply-To: <20150531065035.GB17795@kroah.com>

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 <nikhil.badola@freescale.com>
> > ---
> >  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.




  reply	other threads:[~2015-05-31  7:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-26 11:45 [PATCH 3/5] drivers:usb:fsl: Replace macros with enumerated type Nikhil Badola
2015-05-31  6:50 ` Greg KH
2015-05-31  7:11   ` Joe Perches [this message]
2015-05-31 21:01     ` Greg KH
2015-06-01  6:19       ` Badola Nikhil
2015-06-04  4:05       ` Badola Nikhil
2015-05-31  7:13 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1433056278.2984.16.camel@perches.com \
    --to=joe@perches.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=nikhil.badola@freescale.com \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox