From: Dan Carpenter <error27@gmail.com>
To: Brent Pappas <bpappas@pappasbrent.com>
Cc: sakari.ailus@linux.intel.com, bingbu.cao@intel.com,
tian.shu.qiu@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] mdeia: ipu3: ipu33-mmu: Replace macro IPU3_ADDR2PTE() with a function
Date: Tue, 24 Jan 2023 17:42:21 +0300 [thread overview]
Message-ID: <Y8/uTYK7qmYD5MSA@kadam> (raw)
In-Reply-To: <20230124135554.13787-1-bpappas@pappasbrent.com>
On Tue, Jan 24, 2023 at 08:55:54AM -0500, Brent Pappas wrote:
> Replace the macro IPU3_ADDR2PTE() with a static function to match
> Linux coding style standards.
When you say "Linux coding style standards" what exactly does that mean?
I've just re-read the Documentation/process/coding-style.rst section on
"Macros, Enums and RTL" and I don't see an issue with the macro.
This code is in the middle of a big section full of macros. Why did you
pick this particular macro? Now it doesn't mirror the IPU3_PTE2ADDR()
so this patch hurts readability.
>
> Signed-off-by: Brent Pappas <bpappas@pappasbrent.com>
> ---
> drivers/staging/media/ipu3/ipu3-mmu.c | 18 +++++++++++-------
> 1 file changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/staging/media/ipu3/ipu3-mmu.c b/drivers/staging/media/ipu3/ipu3-mmu.c
> index cb9bf5fb29a5..d2d603c32773 100644
> --- a/drivers/staging/media/ipu3/ipu3-mmu.c
> +++ b/drivers/staging/media/ipu3/ipu3-mmu.c
> @@ -25,7 +25,11 @@
> #define IPU3_PT_SIZE (IPU3_PT_PTES << 2)
> #define IPU3_PT_ORDER (IPU3_PT_SIZE >> PAGE_SHIFT)
>
> -#define IPU3_ADDR2PTE(addr) ((addr) >> IPU3_PAGE_SHIFT)
> +static u32 ipu3_addr2pte(phys_addr_t addr)
> +{
> + return addr >> IPU3_PAGE_SHIFT;
> +}
To me the original macro is fine. The inline would also be fine if it
were done consistently. But I guess I just don't see a lot of value in
changing the existing code.
If you were taking ownership of this driver in a more meaningful way
then I would defer to your taste... But I just don't see a lot of value
in the patch.
regards,
dan carpenter
next prev parent reply other threads:[~2023-01-24 14:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-24 13:55 [PATCH] mdeia: ipu3: ipu33-mmu: Replace macro IPU3_ADDR2PTE() with a function Brent Pappas
2023-01-24 14:42 ` Dan Carpenter [this message]
2023-01-25 14:36 ` Brent Pappas
2023-01-25 15:27 ` Dan Carpenter
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=Y8/uTYK7qmYD5MSA@kadam \
--to=error27@gmail.com \
--cc=bingbu.cao@intel.com \
--cc=bpappas@pappasbrent.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