public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: deep@crimson.net.eu.org
Cc: sakari.ailus@linux.intel.com, bingbu.cao@intel.com,
	mchehab@kernel.org, gregkh@linuxfoundation.org,
	linux-media@vger.kernel.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] media: staging: ipu7: cleanup register names and suffixes
Date: Wed, 15 Apr 2026 13:05:45 +0300	[thread overview]
Message-ID: <ad9i-XhEZ-m8WKVd@stanley.mountain> (raw)
In-Reply-To: <20260415070205.1245502-1-deep@crimson.net.eu.org>

On Wed, Apr 15, 2026 at 09:02:05AM +0200, deep@crimson.net.eu.org wrote:
> From: Kenet Jovan Sokoli <deep@crimson.net.eu.org>
> 
> 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


      reply	other threads:[~2026-04-15 10:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-15  7:02 [PATCH] media: staging: ipu7: cleanup register names and suffixes deep
2026-04-15 10:05 ` 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=ad9i-XhEZ-m8WKVd@stanley.mountain \
    --to=error27@gmail.com \
    --cc=bingbu.cao@intel.com \
    --cc=deep@crimson.net.eu.org \
    --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 \
    /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