Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Josh Law <hlcj1234567@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Josh Law <objecting@objecting.org>
Subject: Re: [PATCH 4/4] arm64: kernel: Fix style in io.c macro
Date: Mon, 2 Mar 2026 18:08:25 +0000	[thread overview]
Message-ID: <aaXSGSEY_3WQvjYS@J2N7QTR9R3> (raw)
In-Reply-To: <3fe578cc-07b3-442b-8eca-1f94c1975e85@gmail.com>

On Mon, Mar 02, 2026 at 03:45:16PM +0000, Josh Law wrote:
> 2 Mar 2026 14:51:19 Mark Rutland <mark.rutland@arm.com>:
> 
> > On Sun, Mar 01, 2026 at 12:34:07AM +0000, Josh Law wrote:
> >> Signed-off-by: Josh Law <objecting@objecting.org>
> >> ---
> >> arch/arm64/kernel/io.c | 6 +++---
> >> 1 file changed, 3 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/arch/arm64/kernel/io.c b/arch/arm64/kernel/io.c
> >> index fe86ada23c7d..ce27fa5d2e37 100644
> >> --- a/arch/arm64/kernel/io.c
> >> +++ b/arch/arm64/kernel/io.c
> >> @@ -17,10 +17,10 @@
> >> #define memcpy_toio_aligned(to, from, count, bits)                        \
> >>     ({                                                                \
> >>         volatile u##bits __iomem *_to = to;                       \
> >> -       const u##bits *_from = from;                              \
> >> +       const u##bits * _from = from;                             \
> >>         size_t _count = count;                                    \
> >> -       const u##bits *_end_from = _from + ALIGN_DOWN(_count, 8); \
> >> -                                                                          \
> >> +       const u##bits * _end_from = _from + ALIGN_DOWN(_count, 8);\
> >> +\
> >
> > There is no style violation here. There's no need to add a space between
> > '*' and the variable name.
> >
> > Mark.
> 
> I used checkpatch.pl... it detected that

So? Tools can be wrong.

In general, checkpatch.pl shouldn't be applied to existing files to find
issues, since there are many deliberate violations, and cases it cannot
parse correctly.

I checked out v7.0-rc2, and ran:

  ./scripts/checkpatch.pl -f arch/arm64/kernel/io.c

... and the warning you see seems to be:

| ERROR: need consistent spacing around '*' (ctx:WxV)
| #20: FILE: arch/arm64/kernel/io.c:20:
| +               const u##bits *_from = from;                              \
|                               ^

From a quick scan of checkpatch.pl, that's because it has mis-parsed
this as a binary operator, where we *do* want consistent space around
the '*'.

For types that's not the case, e.g.

| [mark@lakrids:~/src/linux]% cat test.c                               
| int *foo = 1;
| 
| int * bar = 1;
| [mark@lakrids:~/src/linux]% ./scripts/checkpatch.pl -f test.c        
| WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
| #1: FILE: test.c:1:
| +int *foo = 1;
| 
| ERROR: "foo * bar" should be "foo *bar"
| #3: FILE: test.c:3:
| +int * bar = 1;

Mark.


  reply	other threads:[~2026-03-02 18:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-01  0:34 [PATCH 1/4] arm64: errata: Fix missing space after comma Josh Law
2026-03-01  0:34 ` [PATCH 2/4] arm64: fpsimd: make stack ctl_table const Josh Law
2026-03-01  0:34 ` [PATCH 3/4] arm64: kernel: Move const after static in get_kaslr_seed Josh Law
2026-03-01  0:34 ` [PATCH 4/4] arm64: kernel: Fix style in io.c macro Josh Law
2026-03-02 14:51   ` Mark Rutland
2026-03-02 15:45     ` Josh Law
2026-03-02 18:08       ` Mark Rutland [this message]
2026-03-02 18:21         ` Josh Law
2026-03-03 11:50 ` [PATCH 1/4] arm64: errata: Fix missing space after comma Will Deacon

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=aaXSGSEY_3WQvjYS@J2N7QTR9R3 \
    --to=mark.rutland@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=hlcj1234567@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=objecting@objecting.org \
    --cc=will@kernel.org \
    /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