All of lore.kernel.org
 help / color / mirror / Atom feed
* [lindholm-alpha:for-linus 57/57] arch/alpha/kernel/err_tsunami.c:653:22-23: WARNING opportunity for min()
@ 2026-10-20 17:23 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-10-20 17:23 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Julia Lawall

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Magnus Lindholm <linmag7@gmail.com>
CC: Matt Turner <mattst88@gmail.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/lindholm/alpha.git for-linus
head:   71cf9644bcb35e686c3e12a703325335a0925946
commit: 71cf9644bcb35e686c3e12a703325335a0925946 [57/57] alpha: add bounded Clipper console-log scanning
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: alpha-randconfig-r2105-20261020 (https://download.01.org/0day-ci/archive/20261020/202610201902.6BG70hxk-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 12.5.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202610201902.6BG70hxk-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> arch/alpha/kernel/err_tsunami.c:653:22-23: WARNING opportunity for min()

vim +653 arch/alpha/kernel/err_tsunami.c

71cf9644bcb35e6 Magnus Lindholm 2026-10-14  647  
71cf9644bcb35e6 Magnus Lindholm 2026-10-14  648  static void __init
71cf9644bcb35e6 Magnus Lindholm 2026-10-14  649  tsunami_console_data_log(int cpu, struct percpu_struct *pcpu)
71cf9644bcb35e6 Magnus Lindholm 2026-10-14  650  {
71cf9644bcb35e6 Magnus Lindholm 2026-10-14  651  	unsigned char *data = (void *)(IDENT_ADDR | pcpu->console_data_log_pa);
71cf9644bcb35e6 Magnus Lindholm 2026-10-14  652  	size_t length = pcpu->console_data_log_length;
71cf9644bcb35e6 Magnus Lindholm 2026-10-14 @653  	size_t dump = length < 1024 ? length : 1024;
71cf9644bcb35e6 Magnus Lindholm 2026-10-14  654  
71cf9644bcb35e6 Magnus Lindholm 2026-10-14  655  	printk("%sConsole data log for CPU %d (%zu bytes):\n",
71cf9644bcb35e6 Magnus Lindholm 2026-10-14  656  	       err_print_prefix, cpu, length);
71cf9644bcb35e6 Magnus Lindholm 2026-10-14  657  	if (!(pcpu->console_data_log_pa & 7) &&
71cf9644bcb35e6 Magnus Lindholm 2026-10-14  658  	    length <= ~0UL - (unsigned long)data &&
71cf9644bcb35e6 Magnus Lindholm 2026-10-14  659  	    tsunami_console_log(data, length)) {
71cf9644bcb35e6 Magnus Lindholm 2026-10-14  660  		/* Acknowledge only after reaching a valid termination packet. */
71cf9644bcb35e6 Magnus Lindholm 2026-10-14  661  		pcpu->console_data_log_pa = 0;
71cf9644bcb35e6 Magnus Lindholm 2026-10-14  662  		return;
71cf9644bcb35e6 Magnus Lindholm 2026-10-14  663  	}
71cf9644bcb35e6 Magnus Lindholm 2026-10-14  664  	printk("%s  Incomplete console log; retaining firmware pointer\n",
71cf9644bcb35e6 Magnus Lindholm 2026-10-14  665  	       err_print_prefix);
71cf9644bcb35e6 Magnus Lindholm 2026-10-14  666  	/* Byte reads preserve partial headers without rounding beyond length. */
71cf9644bcb35e6 Magnus Lindholm 2026-10-14  667  	if (dump > ~0UL - (unsigned long)data)
71cf9644bcb35e6 Magnus Lindholm 2026-10-14  668  		return;
71cf9644bcb35e6 Magnus Lindholm 2026-10-14  669  	print_hex_dump(err_print_prefix, "  ", DUMP_PREFIX_OFFSET, 16, 1,
71cf9644bcb35e6 Magnus Lindholm 2026-10-14  670  		       data, dump, false);
71cf9644bcb35e6 Magnus Lindholm 2026-10-14  671  	if (dump < length)
71cf9644bcb35e6 Magnus Lindholm 2026-10-14  672  		printk("%s  Raw console log truncated to %zu bytes\n",
71cf9644bcb35e6 Magnus Lindholm 2026-10-14  673  		       err_print_prefix, dump);
71cf9644bcb35e6 Magnus Lindholm 2026-10-14  674  }
71cf9644bcb35e6 Magnus Lindholm 2026-10-14  675  

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

only message in thread, other threads:[~2026-10-20 17:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-20 17:23 [lindholm-alpha:for-linus 57/57] arch/alpha/kernel/err_tsunami.c:653:22-23: WARNING opportunity for min() kernel test robot

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.