All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Cc: Wayne Porter <wporter82@gmail.com>,
	mchehab@kernel.org, gregkh@linuxfoundation.org,
	linux-media@vger.kernel.org, devel@driverdev.osuosl.org
Subject: Re: [PATCH] [media] v4l: omap4iss: Fix using BIT macro
Date: Mon, 03 Oct 2016 13:01:16 +0300	[thread overview]
Message-ID: <20214585.uMqxn84aLo@avalon> (raw)
In-Reply-To: <20161003065822.65e43177@vento.lan>

On Monday 03 Oct 2016 06:58:22 Mauro Carvalho Chehab wrote:
> Em Sat, 1 Oct 2016 16:37:46 -0700 Wayne Porter escreveu:
> > Checks found by checkpatch
> > 
> > Signed-off-by: Wayne Porter <wporter82@gmail.com>
> > ---
> > 
> >  drivers/staging/media/omap4iss/iss_regs.h | 76 ++++++++++++--------------
> >  1 file changed, 38 insertions(+), 38 deletions(-)
> > 
> > diff --git a/drivers/staging/media/omap4iss/iss_regs.h
> > b/drivers/staging/media/omap4iss/iss_regs.h index cb415e8..c675212 100644
> > --- a/drivers/staging/media/omap4iss/iss_regs.h
> > +++ b/drivers/staging/media/omap4iss/iss_regs.h
> > @@ -42,7 +42,7 @@
> >  #define ISS_CTRL_CLK_DIV_MASK				(3 << 4)
> >  #define ISS_CTRL_INPUT_SEL_MASK				(3 << 2)
> >  #define ISS_CTRL_INPUT_SEL_CSI2A			(0 << 2)
> > -#define ISS_CTRL_INPUT_SEL_CSI2B			(1 << 2)
> > +#define ISS_CTRL_INPUT_SEL_CSI2B			BIT(2)
> 
> Converting just a few of such macros won't help. Either convert all
> or none.
> 
> Also, as most of the bit masks here have more than one bit, you should
> use GENMASK(), instead of BIT, like:
> 
> #define ISS_CTRL_CLK_DIV_MASK		GENMASK(4, 5)
> #define ISS_CTRL_INPUT_SEL_MASK		GENMASK(2, 3)
> #define   ISS_CTRL_INPUT_SEL_CSI2A	0
> #define   ISS_CTRL_INPUT_SEL_CSI2B	BIT(2)
> 
> Yet, not sure if I would like such patch, as this kind of change
> could easily break the driver if you make any typo at the GENMASK
> parameters.

It would be best to automate such a change with a script than performing it 
manually.

-- 
Regards,

Laurent Pinchart


      reply	other threads:[~2016-10-03 10:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-01 23:37 [PATCH] [media] v4l: omap4iss: Fix using BIT macro Wayne Porter
2016-10-03  9:44 ` Laurent Pinchart
2016-10-03  9:58 ` Mauro Carvalho Chehab
2016-10-03 10:01   ` Laurent Pinchart [this message]

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=20214585.uMqxn84aLo@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mchehab@s-opensource.com \
    --cc=wporter82@gmail.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.