From: Aryan Sinha <sinha.aryan03@gmail.com>
To: Matt Turner <mattst88@gmail.com>, Magnus Lindholm <linmag7@gmail.com>
Cc: Richard Henderson <richard.henderson@linaro.org>,
linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org,
Aryan Sinha <sinha.aryan03@gmail.com>,
kernel test robot <lkp@intel.com>
Subject: [PATCH] alpha: use min() in tsunami_console_data_log()
Date: Wed, 4 Nov 2026 20:33:24 +0530 [thread overview]
Message-ID: <20261104150328.33387-1-sinha.aryan03@gmail.com> (raw)
The dump length is an open coded minimum. Use min() instead, and include
minmax.h for it rather than relying on it arriving through another header.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/r/202610201902.6BG70hxk-lkp@intel.com/
Signed-off-by: Aryan Sinha <sinha.aryan03@gmail.com>
---
arch/alpha/kernel/err_tsunami.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/alpha/kernel/err_tsunami.c b/arch/alpha/kernel/err_tsunami.c
index dacf91d95..97e85237a 100644
--- a/arch/alpha/kernel/err_tsunami.c
+++ b/arch/alpha/kernel/err_tsunami.c
@@ -6,6 +6,7 @@
* Register definitions: 21272 Hardware Reference Manual, revision 4.0.
*/
#include <linux/init.h>
+#include <linux/minmax.h>
#include <linux/printk.h>
#include <linux/pci.h>
#include <linux/sched.h>
@@ -650,7 +651,7 @@ tsunami_console_data_log(int cpu, struct percpu_struct *pcpu)
{
unsigned char *data = (void *)(IDENT_ADDR | pcpu->console_data_log_pa);
size_t length = pcpu->console_data_log_length;
- size_t dump = length < 1024 ? length : 1024;
+ size_t dump = min(length, 1024UL);
printk("%sConsole data log for CPU %d (%zu bytes):\n",
err_print_prefix, cpu, length);
--
2.46.0
reply other threads:[~2026-11-04 15:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261104150328.33387-1-sinha.aryan03@gmail.com \
--to=sinha.aryan03@gmail.com \
--cc=linmag7@gmail.com \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=mattst88@gmail.com \
--cc=richard.henderson@linaro.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
all inboxes | Powered by JetHome®