* kernel/debug/kdb/kdb_support.c:624 kdb_task_state_char() warn: unsigned 'p_state' is never less than zero.
@ 2021-07-01 11:56 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-07-01 11:56 UTC (permalink / raw)
To: Peter Zijlstra; +Cc: kbuild-all, linux-kernel, Daniel Bristot de Oliveira
[-- Attachment #1: Type: text/plain, Size: 2131 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dbe69e43372212527abf48609aba7fc39a6daa27
commit: 2f064a59a11ff9bc22e52e9678bc601404c7cb34 sched: Change task_struct::state
date: 13 days ago
config: microblaze-randconfig-m031-20210628 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
smatch warnings:
kernel/debug/kdb/kdb_support.c:624 kdb_task_state_char() warn: unsigned 'p_state' is never less than zero.
vim +/p_state +624 kernel/debug/kdb/kdb_support.c
602
603 /*
604 * kdb_task_state_char - Return the character that represents the task state.
605 * Inputs:
606 * p struct task for the process
607 * Returns:
608 * One character to represent the task state.
609 */
610 char kdb_task_state_char (const struct task_struct *p)
611 {
612 unsigned int p_state;
613 unsigned long tmp;
614 char state;
615 int cpu;
616
617 if (!p ||
618 copy_from_kernel_nofault(&tmp, (char *)p, sizeof(unsigned long)))
619 return 'E';
620
621 cpu = kdb_process_cpu(p);
622 p_state = READ_ONCE(p->__state);
623 state = (p_state == 0) ? 'R' :
> 624 (p_state < 0) ? 'U' :
625 (p_state & TASK_UNINTERRUPTIBLE) ? 'D' :
626 (p_state & TASK_STOPPED) ? 'T' :
627 (p_state & TASK_TRACED) ? 'C' :
628 (p->exit_state & EXIT_ZOMBIE) ? 'Z' :
629 (p->exit_state & EXIT_DEAD) ? 'E' :
630 (p_state & TASK_INTERRUPTIBLE) ? 'S' : '?';
631 if (is_idle_task(p)) {
632 /* Idle task. Is it really idle, apart from the kdb
633 * interrupt? */
634 if (!kdb_task_has_cpu(p) || kgdb_info[cpu].irq_depth == 1) {
635 if (cpu != kdb_initial_cpu)
636 state = 'I'; /* idle task */
637 }
638 } else if (!p->mm && state == 'S') {
639 state = 'M'; /* sleeping system daemon */
640 }
641 return state;
642 }
643
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31343 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-07-01 11:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-01 11:56 kernel/debug/kdb/kdb_support.c:624 kdb_task_state_char() warn: unsigned 'p_state' is never less than zero kernel test robot
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®