linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Cc: Sakari Ailus <sakari.ailus@iki.fi>,
	Linux Media Mailing List <linux-media@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH 1/2] media: i2c: max9286: Use unsigned constants
Date: Wed, 23 Sep 2020 09:42:24 +0200	[thread overview]
Message-ID: <CAMuHMdXv1JRoBTT=XL+q=jwOPnTPYRZMp8pk+_M0WOGofFf0dg@mail.gmail.com> (raw)
In-Reply-To: <20200922155210.242536-2-kieran.bingham+renesas@ideasonboard.com>

Hi Kieran,

On Tue, Sep 22, 2020 at 5:52 PM Kieran Bingham
<kieran.bingham+renesas@ideasonboard.com> wrote:
> Convert the bitfield definitions to use unsigned integers.
>
> Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

Thanks for your patch!

> --- a/drivers/media/i2c/max9286.c
> +++ b/drivers/media/i2c/max9286.c
> @@ -31,85 +31,85 @@
>  #include <media/v4l2-subdev.h>
>
>  /* Register 0x00 */
> -#define MAX9286_MSTLINKSEL_AUTO                (7 << 5)
> +#define MAX9286_MSTLINKSEL_AUTO                (7U << 5)

While using this format for multi-bit fields makes sense...

>  #define MAX9286_MSTLINKSEL(n)          ((n) << 5)
>  #define MAX9286_EN_VS_GEN              BIT(4)
> -#define MAX9286_LINKEN(n)              (1 << (n))
> +#define MAX9286_LINKEN(n)              (1U << (n))

... I think single-bit fields (more below) make better use of the BIT() macro.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2020-09-23  7:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-22 15:52 [PATCH 0/2] gmsl: Use unsigned constants Kieran Bingham
2020-09-22 15:52 ` [PATCH 1/2] media: i2c: max9286: " Kieran Bingham
2020-09-23  7:42   ` Geert Uytterhoeven [this message]
2020-09-23  9:41     ` Kieran Bingham
2020-09-23 11:51       ` Geert Uytterhoeven
2020-09-22 15:52 ` [PATCH 2/2] media: i2c: max9271: " Kieran Bingham

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='CAMuHMdXv1JRoBTT=XL+q=jwOPnTPYRZMp8pk+_M0WOGofFf0dg@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=sakari.ailus@iki.fi \
    /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;
as well as URLs for NNTP newsgroup(s).