From: Nathan Chancellor <nathan@kernel.org>
To: tsbogend@alpha.franken.de
Cc: ndesaulniers@google.com, trix@redhat.com,
linux-mips@vger.kernel.org, llvm@lists.linux.dev,
patches@lists.linux.dev, Nathan Chancellor <nathan@kernel.org>
Subject: [PATCH] MIPS: Drop unused positional parameter in local_irq_{dis,en}able
Date: Tue, 04 Apr 2023 14:18:41 -0700 [thread overview]
Message-ID: <20230404-mips-unused-named-parameters-v1-1-71d6c656f1de@kernel.org> (raw)
When building with clang's integrated assembler, it points out that the
CONFIG_CPU_HAS_DIEI versions of local_irq_enable and local_irq_disable
have a named parameter that is not used in the body of the macro and it
thinks that $8 is a positional parameter, rather than a register:
arch/mips/include/asm/asmmacro.h:48:2: warning: macro defined with named parameters which are not used in macro body, possible positional parameter found in body which will have no effect
.macro local_irq_enable reg=$8
^
The comment above the function that performs this check in LLVM notes
that the warning may trigger in this case, even though it is not
problematic. It is easy enough to clean this up by just omitting the
named parameter for this version of the macro, as it is entirely unused.
Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Link: https://github.com/ClangBuiltLinux/linux/issues/1415
Link: https://github.com/llvm/llvm-project/commit/81c944cadb7f9e55b3517b7423a820e2577b9279
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
arch/mips/include/asm/asmmacro.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/mips/include/asm/asmmacro.h b/arch/mips/include/asm/asmmacro.h
index 1c4438f3f2ab..067a635d3bc8 100644
--- a/arch/mips/include/asm/asmmacro.h
+++ b/arch/mips/include/asm/asmmacro.h
@@ -45,12 +45,12 @@
#endif
#ifdef CONFIG_CPU_HAS_DIEI
- .macro local_irq_enable reg=t0
+ .macro local_irq_enable
ei
irq_enable_hazard
.endm
- .macro local_irq_disable reg=t0
+ .macro local_irq_disable
di
irq_disable_hazard
.endm
---
base-commit: 101f26c72825c5dba1dfe826e4202a9a04b435c6
change-id: 20230404-mips-unused-named-parameters-b32df71aadda
Best regards,
--
Nathan Chancellor <nathan@kernel.org>
next reply other threads:[~2023-04-04 21:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-04 21:18 Nathan Chancellor [this message]
2023-04-05 8:26 ` [PATCH] MIPS: Drop unused positional parameter in local_irq_{dis,en}able Thomas Bogendoerfer
2023-05-15 19:57 ` Maciej W. Rozycki
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=20230404-mips-unused-named-parameters-v1-1-71d6c656f1de@kernel.org \
--to=nathan@kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=ndesaulniers@google.com \
--cc=patches@lists.linux.dev \
--cc=trix@redhat.com \
--cc=tsbogend@alpha.franken.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.