lkml.org 
[lkml]   [2008]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 2/3] x86: Macrofy resuable code
    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


    \
     
     \ /
      Last update: 2008-01-27 10:27    [W:0.021 / U:33.024 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site