[PATCH 1/2] x86_64: ia32_signal.c: remove unnecessary cast to u32 - Kernel

This is a discussion on [PATCH 1/2] x86_64: ia32_signal.c: remove unnecessary cast to u32 - Kernel ; From: Hiroshi Shimamoto __put_user() looks type of the 2nd parameter, so casting the 1st parameter is not necessary. text data bss dec hex filename 6227 0 8 6235 185b ia32_signal.o.new 6227 0 8 6235 185b ia32_signal.o.old Signed-off-by: Hiroshi Shimamoto --- ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: [PATCH 1/2] x86_64: ia32_signal.c: remove unnecessary cast to u32

  1. [PATCH 1/2] x86_64: ia32_signal.c: remove unnecessary cast to u32

    From: Hiroshi Shimamoto

    __put_user() looks type of the 2nd parameter, so casting the 1st parameter
    is not necessary.

    text data bss dec hex filename
    6227 0 8 6235 185b ia32_signal.o.new
    6227 0 8 6235 185b ia32_signal.o.old

    Signed-off-by: Hiroshi Shimamoto
    ---
    arch/x86/ia32/ia32_signal.c | 26 +++++++++++++-------------
    1 files changed, 13 insertions(+), 13 deletions(-)

    diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c
    index e47bed2..690a480 100644
    --- a/arch/x86/ia32/ia32_signal.c
    +++ b/arch/x86/ia32/ia32_signal.c
    @@ -351,21 +351,21 @@ static int ia32_setup_sigcontext(struct sigcontext_ia32 __user *sc,
    savesegment(es, tmp);
    err |= __put_user(tmp, (unsigned int __user *)&sc->es);

    - err |= __put_user((u32)regs->di, &sc->di);
    - err |= __put_user((u32)regs->si, &sc->si);
    - err |= __put_user((u32)regs->bp, &sc->bp);
    - err |= __put_user((u32)regs->sp, &sc->sp);
    - err |= __put_user((u32)regs->bx, &sc->bx);
    - err |= __put_user((u32)regs->dx, &sc->dx);
    - err |= __put_user((u32)regs->cx, &sc->cx);
    - err |= __put_user((u32)regs->ax, &sc->ax);
    - err |= __put_user((u32)regs->cs, &sc->cs);
    - err |= __put_user((u32)regs->ss, &sc->ss);
    + err |= __put_user(regs->di, &sc->di);
    + err |= __put_user(regs->si, &sc->si);
    + err |= __put_user(regs->bp, &sc->bp);
    + err |= __put_user(regs->sp, &sc->sp);
    + err |= __put_user(regs->bx, &sc->bx);
    + err |= __put_user(regs->dx, &sc->dx);
    + err |= __put_user(regs->cx, &sc->cx);
    + err |= __put_user(regs->ax, &sc->ax);
    + err |= __put_user(regs->cs, &sc->cs);
    + err |= __put_user(regs->ss, &sc->ss);
    err |= __put_user(current->thread.trap_no, &sc->trapno);
    err |= __put_user(current->thread.error_code, &sc->err);
    - err |= __put_user((u32)regs->ip, &sc->ip);
    - err |= __put_user((u32)regs->flags, &sc->flags);
    - err |= __put_user((u32)regs->sp, &sc->sp_at_signal);
    + err |= __put_user(regs->ip, &sc->ip);
    + err |= __put_user(regs->flags, &sc->flags);
    + err |= __put_user(regs->sp, &sc->sp_at_signal);

    tmp = save_i387_xstate_ia32(fpstate);
    if (tmp < 0)
    --
    1.5.6

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. [PATCH 2/2] x86_64: ia32_signal.c remove unnecessary function calls

    From: Hiroshi Shimamoto

    the below 2 functions are called in save_i387_xstate_ia32()
    - clear_used_math();
    - stts();

    Signed-off-by: Hiroshi Shimamoto
    ---
    arch/x86/ia32/ia32_signal.c | 5 +----
    1 files changed, 1 insertions(+), 4 deletions(-)

    diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c
    index 690a480..4bc02b2 100644
    --- a/arch/x86/ia32/ia32_signal.c
    +++ b/arch/x86/ia32/ia32_signal.c
    @@ -370,12 +370,9 @@ static int ia32_setup_sigcontext(struct sigcontext_ia32 __user *sc,
    tmp = save_i387_xstate_ia32(fpstate);
    if (tmp < 0)
    err = -EFAULT;
    - else {
    - clear_used_math();
    - stts();
    + else
    err |= __put_user(ptr_to_compat(tmp ? fpstate : NULL),
    &sc->fpstate);
    - }

    /* non-iBCS2 extensions.. */
    err |= __put_user(mask, &sc->oldmask);
    --
    1.5.6

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread