From: Julia Lawall <julia.lawall@inria.fr>
To: Sam Muhammed <jane.pnx9@gmail.com>
Cc: Stefano Brivio <sbrivio@redhat.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH v2] Staging: media: omap4iss: Use BIT() macro
Date: Sat, 4 Apr 2020 14:55:02 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.21.2004041451060.2354@hadrien> (raw)
In-Reply-To: <bace205763db970618b1d1541133826a874b1e21.camel@gmail.com>
> > > #define CSI2_SYSCONFIG_MSTANDBY_MODE_MASK (3 << 12)
> > > #define CSI2_SYSCONFIG_MSTANDBY_MODE_FORCE (0 << 12)
> > > -#define CSI2_SYSCONFIG_MSTANDBY_MODE_NO (1 << 12)
> > > +#define CSI2_SYSCONFIG_MSTANDBY_MODE_NO BIT(12)
> > > #define CSI2_SYSCONFIG_MSTANDBY_MODE_SMART (2 << 12)
> >
>
> Hi Stefano,
> honestly i'am confused about how is there a difference between BIT(x)
> and (1 << x)
In the original code you have a bunch of things shifted to the left by 12
bits. 3 0 1 and 2. They all look the same, and one can think about a
little region of bits some of which can be on and some of which can be off.
If you put BIT(12) in one case you don't see that.
For example, if you had
1 + 100
2 + 100
3 + 100
104
5 + 100
How easy is it to check that you have a sequence of 5 numbers? It's really
easy to add a single digit integer to 100, but probably you had to think
just a little extra bit when you came to 104, because it's not following
the same pattern.
julia
next prev parent reply other threads:[~2020-04-04 12:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-31 22:58 [PATCH v2] Staging: media: omap4iss: Use BIT() macro Sam Muhammed
2020-04-01 2:55 ` [Outreachy kernel] " Stefano Brivio
2020-04-04 5:33 ` Sam Muhammed
2020-04-04 12:11 ` Stefano Brivio
2020-04-04 19:32 ` Sam Muhammed
2020-04-04 23:52 ` Stefano Brivio
2020-04-05 0:41 ` Sam Muhammed
2020-04-04 12:55 ` Julia Lawall [this message]
2020-04-04 19:50 ` Sam Muhammed
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=alpine.DEB.2.21.2004041451060.2354@hadrien \
--to=julia.lawall@inria.fr \
--cc=gregkh@linuxfoundation.org \
--cc=jane.pnx9@gmail.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=mchehab@kernel.org \
--cc=outreachy-kernel@googlegroups.com \
--cc=sbrivio@redhat.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.