From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Namrata A Shettar <namrataashettar@gmail.com>,
outreachy-kernel <outreachy-kernel@googlegroups.com>
Subject: Re: [Outreachy kernel] Re: [PATCH] staging: octeon-usb: Prefer using BIT macro
Date: Mon, 3 Oct 2016 12:13:12 +0200 [thread overview]
Message-ID: <20161003101312.GB6060@kroah.com> (raw)
In-Reply-To: <20161003092527.GB4579@kroah.com>
On Mon, Oct 03, 2016 at 11:25:27AM +0200, Greg Kroah-Hartman wrote:
> On Mon, Oct 03, 2016 at 11:20:49AM +0300, Aaro Koskinen wrote:
> > Hi,
> >
> > On Mon, Oct 03, 2016 at 09:01:36AM +0200, Greg Kroah-Hartman wrote:
> > > On Mon, Oct 03, 2016 at 03:03:13AM +0300, Aaro Koskinen wrote:
> > > > On Mon, Oct 03, 2016 at 12:03:25AM +0530, Namrata A Shettar wrote:
> > > > > - CVMX_USB_INITIALIZE_FLAGS_CLOCK_XO_XI = 1 << 0,
> > > > > - CVMX_USB_INITIALIZE_FLAGS_CLOCK_XO_GND = 1 << 1,
> > > > > + CVMX_USB_INITIALIZE_FLAGS_CLOCK_XO_XI = BIT(0),
> > > > > + CVMX_USB_INITIALIZE_FLAGS_CLOCK_XO_GND = BIT(1),
> > > > > CVMX_USB_INITIALIZE_FLAGS_CLOCK_MHZ_MASK = 3 << 3,
> > > > > - CVMX_USB_INITIALIZE_FLAGS_CLOCK_12MHZ = 1 << 3,
> > > > > + CVMX_USB_INITIALIZE_FLAGS_CLOCK_12MHZ = BIT(3),
> > > > > CVMX_USB_INITIALIZE_FLAGS_CLOCK_24MHZ = 2 << 3,
> > > > > CVMX_USB_INITIALIZE_FLAGS_CLOCK_48MHZ = 3 << 3,
> > > > > /* Bits 3-4 used to encode the clock frequency */
> > > > > - CVMX_USB_INITIALIZE_FLAGS_NO_DMA = 1 << 5,
> > > > > + CVMX_USB_INITIALIZE_FLAGS_NO_DMA = BIT(5),
> > > >
> > > > All entries should be converted to use BIT.
> > >
> > > The ones that could be, were, right? What else should be done here?
> >
> > 24MHZ is BIT(4).
>
> Oh yeah, nice catch.
>
> > > Well, there are bit mask macros now in the kernel tree, perhaps those
> > > should be used, but I don't see how BIT() could be used for "3 << 3", do
> > > you?
> >
> > BIT(3) | BIT(4)?
>
> Maybe, but it's not an automatic conversion :)
But it could be, if you use GENMASK() instead, I'm sure you can write up
a transformation rule to do that in an automated way so that you know it
works properly...
thanks,
greg k-h
next prev parent reply other threads:[~2016-10-03 10:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-02 18:33 [PATCH] staging: octeon-usb: Prefer using BIT macro Namrata A Shettar
[not found] ` <20161003000313.GB11244@raspberrypi.musicnaut.iki.fi>
2016-10-03 7:01 ` Greg Kroah-Hartman
[not found] ` <20161003082049.GB15204@raspberrypi.musicnaut.iki.fi>
2016-10-03 9:25 ` Greg Kroah-Hartman
2016-10-03 10:13 ` Greg Kroah-Hartman [this message]
2016-10-03 16:57 ` [Outreachy kernel] " Namrata A Shettar
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=20161003101312.GB6060@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=aaro.koskinen@iki.fi \
--cc=namrataashettar@gmail.com \
--cc=outreachy-kernel@googlegroups.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.