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