mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] alpha: use min() in tsunami_console_data_log()
@ 2026-11-04 15:03 Aryan Sinha
  0 siblings, 0 replies; only message in thread
From: Aryan Sinha @ 2026-11-04 15:03 UTC (permalink / raw)
  To: Matt Turner, Magnus Lindholm
  Cc: Richard Henderson, linux-alpha, linux-kernel, Aryan Sinha,
	kernel test robot

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-04 15:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-04 15:03 [PATCH] alpha: use min() in tsunami_console_data_log() Aryan Sinha

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®