From: Dan Carpenter <dan.carpenter@linaro.org>
To: Bogdan Sandu <bogdanelsandu2011@gmail.com>
Cc: gregkh@linuxfoundation.org, bingbu.cao@intel.com,
linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
linux-staging@lists.linux.dev, mchehab@kernel.org,
sakari.ailus@linux.intel.com, tian.shu.qiu@intel.com
Subject: Re: [PATCH v2 4/4] media: ipu3: use BIT()
Date: Mon, 2 Feb 2026 23:08:31 +0300 [thread overview]
Message-ID: <aYEEP0m-1_xAXZZV@stanley.mountain> (raw)
In-Reply-To: <20260202175033.8640-5-bogdanelsandu2011@gmail.com>
On Mon, Feb 02, 2026 at 07:50:33PM +0200, Bogdan Sandu wrote:
> Prefer BIT() macro over manual bitshift.
>
> Signed-off-by: Bogdan Sandu <bogdanelsandu2011@gmail.com>
> ---
> drivers/staging/media/ipu3/ipu3-mmu.c | 2 +-
> drivers/staging/media/ipu3/ipu3-mmu.h | 4 +++-
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/media/ipu3/ipu3-mmu.c b/drivers/staging/media/ipu3/ipu3-mmu.c
> index cb9bf5fb2..95ce34ad8 100644
> --- a/drivers/staging/media/ipu3/ipu3-mmu.c
> +++ b/drivers/staging/media/ipu3/ipu3-mmu.c
> @@ -21,7 +21,7 @@
> #include "ipu3-mmu.h"
>
> #define IPU3_PT_BITS 10
> -#define IPU3_PT_PTES (1UL << IPU3_PT_BITS)
> +#define IPU3_PT_PTES (BIT(IPU3_PT_BITS))
IPU3_PT_PTES isn't a bit, it's the number of PTEs. It's just shifting
because it's a power of two and that's how you calculate power of two.
> #define IPU3_PT_SIZE (IPU3_PT_PTES << 2)
> #define IPU3_PT_ORDER (IPU3_PT_SIZE >> PAGE_SHIFT)
>
> diff --git a/drivers/staging/media/ipu3/ipu3-mmu.h b/drivers/staging/media/ipu3/ipu3-mmu.h
> index a5f0bca7e..990482f10 100644
> --- a/drivers/staging/media/ipu3/ipu3-mmu.h
> +++ b/drivers/staging/media/ipu3/ipu3-mmu.h
> @@ -5,8 +5,10 @@
> #ifndef __IPU3_MMU_H
> #define __IPU3_MMU_H
>
> +#include <linux/bitops.h>
> +
> #define IPU3_PAGE_SHIFT 12
> -#define IPU3_PAGE_SIZE (1UL << IPU3_PAGE_SHIFT)
> +#define IPU3_PAGE_SIZE (BIT(IPU3_PAGE_SHIFT))
Same. This is a size, not a bit.
regards,
dan carpenter
prev parent reply other threads:[~2026-02-02 20:08 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-02 10:03 [PATCH] Cleanup ipu3 driver Bogdan Sandu
2026-02-02 10:14 ` Greg KH
2026-02-02 10:18 ` [RE:PATCH] " Bogdan Sandu
2026-02-02 10:18 ` [PATCH] " Bogdan Sandu
2026-02-02 10:32 ` Greg KH
2026-02-02 10:34 ` Bogdan Sandu
2026-02-02 17:50 ` [PATCH v2 0/4] Cleanup media:ipu3 driver Bogdan Sandu
2026-02-02 17:50 ` [PATCH v2 1/4] media: ipu3: fix alignment Bogdan Sandu
2026-03-05 8:15 ` Sakari Ailus
2026-03-11 18:39 ` Bogdan Sandu
2026-02-02 17:50 ` [PATCH v2 2/4] media: ipu3: use tabs Bogdan Sandu
2026-03-05 8:16 ` Sakari Ailus
2026-02-02 17:50 ` [PATCH v2 3/4] media: ipu3: avoid ending lines with paranthesis Bogdan Sandu
2026-02-02 17:50 ` [PATCH v2 4/4] media: ipu3: use BIT() Bogdan Sandu
2026-02-02 20:08 ` Dan Carpenter [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=aYEEP0m-1_xAXZZV@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=bingbu.cao@intel.com \
--cc=bogdanelsandu2011@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=tian.shu.qiu@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox