lkml.org 
[lkml]   [2022]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] x86/mm: Directly return instead of using local ret variable
    Date
    fixes coccinelle warning:
    ./arch/x86/mm/pf_in.c:133:18-20: Unneeded variable: "rv". Return "OTHERS" on line 144

    Signed-off-by: Haowen Bai <baihaowen@meizu.com>
    ---
    arch/x86/mm/pf_in.c | 3 +--
    1 file changed, 1 insertion(+), 2 deletions(-)

    diff --git a/arch/x86/mm/pf_in.c b/arch/x86/mm/pf_in.c
    index 3f83e31..4eff3ee 100644
    --- a/arch/x86/mm/pf_in.c
    +++ b/arch/x86/mm/pf_in.c
    @@ -130,7 +130,6 @@ enum reason_type get_ins_type(unsigned long ins_addr)
    unsigned char *p;
    struct prefix_bits prf;
    int i;
    - enum reason_type rv = OTHERS;

    p = (unsigned char *)ins_addr;
    p += skip_prefix(p, &prf);
    @@ -141,7 +140,7 @@ enum reason_type get_ins_type(unsigned long ins_addr)
    CHECK_OP_TYPE(opcode, imm_wop, IMM_WRITE);

    exit:
    - return rv;
    + return OTHERS;
    }
    #undef CHECK_OP_TYPE

    --
    2.7.4
    \
     
     \ /
      Last update: 2022-03-28 04:13    [W:10.630 / U:0.036 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site