mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Mike Rapoport (IBM)" <rppt@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Luis Chamberlain <mcgrof@kernel.org>
Subject: arch/sh/kernel/kprobes.c:412:24: warning: variable 'p' set but not used
Date: Thu, 15 May 2025 22:05:06 +0800	[thread overview]
Message-ID: <202505151341.EuRFR22l-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   9f35e33144ae5377d6a8de86dd3bd4d995c6ac65
commit: 7582b7be16d0ba90e3dbd9575a730cabd9eb852a kprobes: remove dependency on CONFIG_MODULES
date:   1 year ago
config: sh-randconfig-2003-20250513 (https://download.01.org/0day-ci/archive/20250515/202505151341.EuRFR22l-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250515/202505151341.EuRFR22l-lkp@intel.com/reproduce)

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>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505151341.EuRFR22l-lkp@intel.com/

All warnings (new ones prefixed by >>):

   arch/sh/kernel/kprobes.c:52:16: warning: no previous prototype for 'arch_copy_kprobe' [-Wmissing-prototypes]
      52 | void __kprobes arch_copy_kprobe(struct kprobe *p)
         |                ^~~~~~~~~~~~~~~~
   arch/sh/kernel/kprobes.c:304:15: warning: no previous prototype for 'trampoline_probe_handler' [-Wmissing-prototypes]
     304 | int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
         |               ^~~~~~~~~~~~~~~~~~~~~~~~
   arch/sh/kernel/kprobes.c: In function 'kprobe_exceptions_notify':
>> arch/sh/kernel/kprobes.c:412:24: warning: variable 'p' set but not used [-Wunused-but-set-variable]
     412 |         struct kprobe *p = NULL;
         |                        ^


vim +/p +412 arch/sh/kernel/kprobes.c

d39f5450146ff3 Chris Smith      2008-09-05  405  
d39f5450146ff3 Chris Smith      2008-09-05  406  /*
d39f5450146ff3 Chris Smith      2008-09-05  407   * Wrapper routine to for handling exceptions.
d39f5450146ff3 Chris Smith      2008-09-05  408   */
d39f5450146ff3 Chris Smith      2008-09-05  409  int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
d39f5450146ff3 Chris Smith      2008-09-05  410  				       unsigned long val, void *data)
d39f5450146ff3 Chris Smith      2008-09-05  411  {
d39f5450146ff3 Chris Smith      2008-09-05 @412  	struct kprobe *p = NULL;
d39f5450146ff3 Chris Smith      2008-09-05  413  	struct die_args *args = (struct die_args *)data;
d39f5450146ff3 Chris Smith      2008-09-05  414  	int ret = NOTIFY_DONE;
d39f5450146ff3 Chris Smith      2008-09-05  415  	kprobe_opcode_t *addr = NULL;
d39f5450146ff3 Chris Smith      2008-09-05  416  	struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
d39f5450146ff3 Chris Smith      2008-09-05  417  
d39f5450146ff3 Chris Smith      2008-09-05  418  	addr = (kprobe_opcode_t *) (args->regs->pc);
d3023897b4370b Michael Karcher  2019-06-12  419  	if (val == DIE_TRAP &&
d3023897b4370b Michael Karcher  2019-06-12  420  	    args->trapnr == (BREAKPOINT_INSTRUCTION & 0xff)) {
d39f5450146ff3 Chris Smith      2008-09-05  421  		if (!kprobe_running()) {
d39f5450146ff3 Chris Smith      2008-09-05  422  			if (kprobe_handler(args->regs)) {
d39f5450146ff3 Chris Smith      2008-09-05  423  				ret = NOTIFY_STOP;
d39f5450146ff3 Chris Smith      2008-09-05  424  			} else {
d39f5450146ff3 Chris Smith      2008-09-05  425  				/* Not a kprobe trap */
ee386de77419f9 Paul Mundt       2008-09-08  426  				ret = NOTIFY_DONE;
d39f5450146ff3 Chris Smith      2008-09-05  427  			}
d39f5450146ff3 Chris Smith      2008-09-05  428  		} else {
d39f5450146ff3 Chris Smith      2008-09-05  429  			p = get_kprobe(addr);
d39f5450146ff3 Chris Smith      2008-09-05  430  			if ((kcb->kprobe_status == KPROBE_HIT_SS) ||
d39f5450146ff3 Chris Smith      2008-09-05  431  			    (kcb->kprobe_status == KPROBE_REENTER)) {
d39f5450146ff3 Chris Smith      2008-09-05  432  				if (post_kprobe_handler(args->regs))
d39f5450146ff3 Chris Smith      2008-09-05  433  					ret = NOTIFY_STOP;
d39f5450146ff3 Chris Smith      2008-09-05  434  			} else {
fa5a24b16f9441 Masami Hiramatsu 2018-06-20  435  				if (kprobe_handler(args->regs))
d39f5450146ff3 Chris Smith      2008-09-05  436  					ret = NOTIFY_STOP;
d39f5450146ff3 Chris Smith      2008-09-05  437  			}
d39f5450146ff3 Chris Smith      2008-09-05  438  		}
d39f5450146ff3 Chris Smith      2008-09-05  439  	}
d39f5450146ff3 Chris Smith      2008-09-05  440  
d39f5450146ff3 Chris Smith      2008-09-05  441  	return ret;
d39f5450146ff3 Chris Smith      2008-09-05  442  }
d39f5450146ff3 Chris Smith      2008-09-05  443  

:::::: The code at line 412 was first introduced by commit
:::::: d39f5450146ff39f66cfde9d5184420627d0ac51 sh: Add kprobes support.

:::::: TO: Chris Smith <chris.smith@st.com>
:::::: CC: Paul Mundt <lethal@linux-sh.org>

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

                 reply	other threads:[~2025-05-15 14:05 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=202505151341.EuRFR22l-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=rppt@kernel.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®