mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Abhishek Sagar <sagar.abhishek@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	jkenisto@us.ibm.com, ananth@in.ibm.com,
	Masami Hiramatsu <mhiramat@redhat.com>,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH 2/3] x86: Macrofy resuable code
Date: Sun, 27 Jan 2008 10:23:44 +0100	[thread overview]
Message-ID: <20080127092344.GB18116@uranus.ravnborg.org> (raw)
In-Reply-To: <479C4A42.1020602@gmail.com>

On Sun, Jan 27, 2008 at 02:39:22PM +0530, Abhishek Sagar wrote:
> Encapsulate reusable code .
> 
> Signed-off-by: Abhishek Sagar <sagar.abhishek@gmail.com>
> ---
> 
> diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c
> index a99e764..45f2949 100644
> --- a/arch/x86/kernel/kprobes.c
> +++ b/arch/x86/kernel/kprobes.c
> @@ -74,6 +74,13 @@ DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
>  #define stack_addr(regs) ((unsigned long *)&regs->sp)
>  #endif
>  
> +#define kprobe_bkpt_addr(regs) \
> +	((unsigned long)(regs->ip - sizeof(kprobe_opcode_t)))
> +
> +#define is_jprobe_bkpt(ptr) \
> +	((ptr > (u8 *)jprobe_return) && (ptr < (u8 *)jprobe_return_end))
> +
> +
Small static functions are preferred over macros.
Any particular reason to use a macro here?

	Sam

  reply	other threads:[~2008-01-27  9:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-27  9:09 Abhishek Sagar
2008-01-27  9:23 ` Sam Ravnborg [this message]
2008-01-27 13:31   ` Abhishek Sagar

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=20080127092344.GB18116@uranus.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=ananth@in.ibm.com \
    --cc=jkenisto@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@redhat.com \
    --cc=mingo@elte.hu \
    --cc=sagar.abhishek@gmail.com \
    /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®