All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: arch/riscv/kernel/traps.c:62 dump_instr() error: uninitialized symbol 'val'.
Date: Wed, 30 Oct 2024 20:39:01 +0800	[thread overview]
Message-ID: <202410302031.iWYd3SJk-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Yunhui Cui <cuiyunhui@bytedance.com>
CC: Palmer Dabbelt <palmer@rivosinc.com>
CC: "Björn Töpel" <bjorn@rivosinc.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   c1e939a21eb111a6d6067b38e8e04b8809b64c4e
commit: b8a03a634129b61a7ec69ece4460297ffbd790dc riscv: add userland instruction dump to RISC-V splats
date:   12 months ago
:::::: branch date: 10 hours ago
:::::: commit date: 12 months ago
config: riscv-randconfig-r071-20241030 (https://download.01.org/0day-ci/archive/20241030/202410302031.iWYd3SJk-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)

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: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202410302031.iWYd3SJk-lkp@intel.com/

New smatch warnings:
arch/riscv/kernel/traps.c:62 dump_instr() error: uninitialized symbol 'val'.

Old smatch warnings:
arch/riscv/include/asm/syscall.h:88 syscall_handler() warn: inconsistent indenting
arch/riscv/kernel/traps.c:375 is_valid_bugaddr() warn: unsigned 'pc' is never less than zero.

vim +/val +62 arch/riscv/kernel/traps.c

b8a03a634129b6 Yunhui Cui  2023-09-12  50  
b8a03a634129b6 Yunhui Cui  2023-09-12  51  static void dump_instr(const char *loglvl, struct pt_regs *regs)
eb165bfa8eafc3 Björn Töpel 2023-01-19  52  {
eb165bfa8eafc3 Björn Töpel 2023-01-19  53  	char str[sizeof("0000 ") * 12 + 2 + 1], *p = str;
eb165bfa8eafc3 Björn Töpel 2023-01-19  54  	const u16 *insns = (u16 *)instruction_pointer(regs);
eb165bfa8eafc3 Björn Töpel 2023-01-19  55  	long bad;
eb165bfa8eafc3 Björn Töpel 2023-01-19  56  	u16 val;
eb165bfa8eafc3 Björn Töpel 2023-01-19  57  	int i;
eb165bfa8eafc3 Björn Töpel 2023-01-19  58  
eb165bfa8eafc3 Björn Töpel 2023-01-19  59  	for (i = -10; i < 2; i++) {
b8a03a634129b6 Yunhui Cui  2023-09-12  60  		bad = copy_code(regs, &val, &insns[i]);
eb165bfa8eafc3 Björn Töpel 2023-01-19  61  		if (!bad) {
eb165bfa8eafc3 Björn Töpel 2023-01-19 @62  			p += sprintf(p, i == 0 ? "(%04hx) " : "%04hx ", val);
eb165bfa8eafc3 Björn Töpel 2023-01-19  63  		} else {
eb165bfa8eafc3 Björn Töpel 2023-01-19  64  			printk("%sCode: Unable to access instruction at 0x%px.\n",
eb165bfa8eafc3 Björn Töpel 2023-01-19  65  			       loglvl, &insns[i]);
eb165bfa8eafc3 Björn Töpel 2023-01-19  66  			return;
eb165bfa8eafc3 Björn Töpel 2023-01-19  67  		}
eb165bfa8eafc3 Björn Töpel 2023-01-19  68  	}
eb165bfa8eafc3 Björn Töpel 2023-01-19  69  	printk("%sCode: %s\n", loglvl, str);
eb165bfa8eafc3 Björn Töpel 2023-01-19  70  }
eb165bfa8eafc3 Björn Töpel 2023-01-19  71  

:::::: The code at line 62 was first introduced by commit
:::::: eb165bfa8eafc3d306e34b238e53aafb35dce102 riscv: Add instruction dump to RISC-V splats

:::::: TO: Björn Töpel <bjorn@rivosinc.com>
:::::: CC: Palmer Dabbelt <palmer@rivosinc.com>

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

             reply	other threads:[~2024-10-30 12:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-30 12:39 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-11-26 22:39 arch/riscv/kernel/traps.c:62 dump_instr() error: uninitialized symbol 'val' kernel test robot

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=202410302031.iWYd3SJk-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@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 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.