From: Karl Mehltretter <kmehltretter@gmail.com>
To: Dan Williams <djbw@kernel.org>
Cc: Karl Mehltretter <kmehltretter@gmail.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Davidlohr Bueso <dave@stgolabs.net>,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev
Subject: [PATCH] memregion: fix cache invalidation warning message
Date: Sat, 8 Aug 2026 14:19:43 +0200 [thread overview]
Message-ID: <20260808121943.72939-1-kmehltretter@gmail.com> (raw)
WARN_ON_ONCE() takes a condition, not a message. The string literal is
always true, so the warning still triggers but the message is never
printed.
Use WARN_ONCE(1, ...) instead to print the message and keep the
once-only behavior.
Found with a Coccinelle script. Clang's -Wstring-conversion also flags
such calls but is not enabled in kernel builds.
Fixes: 1156b4418db0 ("memregion: Add cpu_cache_invalidate_memregion() interface")
Assisted-by: Claude:claude-fable-5 coccinelle
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
---
include/linux/memregion.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/memregion.h b/include/linux/memregion.h
index a55f62cc5266..50a6d2ed432e 100644
--- a/include/linux/memregion.h
+++ b/include/linux/memregion.h
@@ -58,7 +58,7 @@ static inline bool cpu_cache_has_invalidate_memregion(void)
static inline int cpu_cache_invalidate_memregion(phys_addr_t start, size_t len)
{
- WARN_ON_ONCE("CPU cache invalidation required");
+ WARN_ONCE(1, "CPU cache invalidation required");
return -ENXIO;
}
#endif
--
2.39.5 (Apple Git-154)
next reply other threads:[~2026-08-08 12:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-08 12:19 Karl Mehltretter [this message]
2026-09-12 9:19 ` Karl Mehltretter
2026-09-23 1:44 ` Jonathan Cameron
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=20260808121943.72939-1-kmehltretter@gmail.com \
--to=kmehltretter@gmail.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=dave.hansen@linux.intel.com \
--cc=dave@stgolabs.net \
--cc=djbw@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
/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
all inboxes | Powered by JetHome®