Re: [PATCH] media: staging: ipu7: cleanup register names and suffixes
From: Dan Carpenter
Date: Wed Apr 15 2026 - 06:08:17 EST
On Wed, Apr 15, 2026 at 09:02:05AM +0200, deep@xxxxxxxxxxxxxxxxxx wrote:
> From: Kenet Jovan Sokoli <deep@xxxxxxxxxxxxxxxxxx>
>
> Rename BUTTRESS_ registers to include IPU7_ prefix and
> remove unnecessary U suffixes from numeric constants
> for consistency.
>
The the renames and changing the types from u32 to int should probably
be done in separate patches.
You need to be a bit careful with changing types. Generally, you should
use unsigned types for bitwise operations. So the _MASK variables should
be unsigned.
> diff --git a/drivers/staging/media/ipu7/ipu7-mmu.c b/drivers/staging/media/ipu7/ipu7-mmu.c
> index 6ded07ccd780..c5f83023ddbd 100644
> --- a/drivers/staging/media/ipu7/ipu7-mmu.c
> +++ b/drivers/staging/media/ipu7/ipu7-mmu.c
> @@ -33,16 +33,16 @@
>
> #define ISP_PAGE_SHIFT 12
> #define ISP_PAGE_SIZE BIT(ISP_PAGE_SHIFT)
> -#define ISP_PAGE_MASK (~(ISP_PAGE_SIZE - 1U))
> +#define IPU7_ISP_PAGE_MASK (~(ISP_PAGE_SIZE - 1))
>
> #define ISP_L1PT_SHIFT 22
> -#define ISP_L1PT_MASK (~((1U << ISP_L1PT_SHIFT) - 1))
> +#define IPU7_ISP_L1PT_MASK (~((1 << ISP_L1PT_SHIFT) - 1))
>
> #define ISP_L2PT_SHIFT 12
> -#define ISP_L2PT_MASK (~(ISP_L1PT_MASK | (~(ISP_PAGE_MASK))))
> +#define ISP_L2PT_MASK (~(IPU7_ISP_L1PT_MASK | (~(IPU7_ISP_PAGE_MASK))))
In the original code this was 0x3ff000 but now, because of sign
extension, it is 0xffffffff003ff000. Does it make a difference?
I don't know. But it makes me uncomfortable to see all these changes
thrown together like this where it's so hard to spot.
regards,
dan carpenter