public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Chen Zhongjin <chenzhongjin@huawei.com>
Cc: <linux-kernel@vger.kernel.org>, <tglx@linutronix.de>,
	<mingo@redhat.com>, <bp@alien8.de>, <dave.hansen@linux.intel.com>,
	<x86@kernel.org>, <hpa@zytor.com>, <mhiramat@kernel.org>,
	<jpoimboe@kernel.org>, <rostedt@goodmis.org>,
	<peterz@infradead.org>, <namit@vmware.com>
Subject: Re: [PATCH -next] x86: kprobes: Remove unused macro stack_addr
Date: Sun, 25 Sep 2022 10:23:08 +0900	[thread overview]
Message-ID: <20220925102308.96ed6863020cfbebd69223ee@kernel.org> (raw)
In-Reply-To: <20220924072629.104759-1-chenzhongjin@huawei.com>

On Sat, 24 Sep 2022 15:26:29 +0800
Chen Zhongjin <chenzhongjin@huawei.com> wrote:

> An unused macro reported by [-Wunused-macros].
> 
> This macro is used to access the sp in pt_regs because at that time
> x86_32 can only get sp by kernel_stack_pointer(regs).
> 
> '3c88c692c287 ("x86/stackframe/32: Provide consistent pt_regs")'
> This commit have unified the pt_regs and from them we can get sp from
> pt_regs with regs->sp easily. Nowhere is using this macro anymore.
> 
> Refrencing pt_regs directly is more clear. Remove this macro for
> code cleaning.

Thanks for the clean up!

Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>

Thank you,

> 
> Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com>
> ---
>  arch/x86/kernel/kprobes/core.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
> index 4c3c27b6aea3..eb8bc82846b9 100644
> --- a/arch/x86/kernel/kprobes/core.c
> +++ b/arch/x86/kernel/kprobes/core.c
> @@ -59,8 +59,6 @@
>  DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
>  DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
>  
> -#define stack_addr(regs) ((unsigned long *)regs->sp)
> -
>  #define W(row, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, ba, bb, bc, bd, be, bf)\
>  	(((b0##UL << 0x0)|(b1##UL << 0x1)|(b2##UL << 0x2)|(b3##UL << 0x3) |   \
>  	  (b4##UL << 0x4)|(b5##UL << 0x5)|(b6##UL << 0x6)|(b7##UL << 0x7) |   \
> -- 
> 2.17.1
> 


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

      reply	other threads:[~2022-09-25  1:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-24  7:26 [PATCH -next] x86: kprobes: Remove unused macro stack_addr Chen Zhongjin
2022-09-25  1:23 ` Masami Hiramatsu [this message]

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=20220925102308.96ed6863020cfbebd69223ee@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=bp@alien8.de \
    --cc=chenzhongjin@huawei.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namit@vmware.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=x86@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