lkml.org 
[lkml]   [2020]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.14 060/125] arm64: alternative: Use true and false for boolean values
    Date
    From: Gustavo A. R. Silva <gustavo@embeddedor.com>

    [ Upstream commit 3c4d9137eefecf273a520d392071ffc9df0a9a7a ]

    Return statements in functions returning bool should use true or false
    instead of an integer value. This code was detected with the help of
    Coccinelle.

    Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
    Signed-off-by: Will Deacon <will.deacon@arm.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    arch/arm64/kernel/alternative.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/arch/arm64/kernel/alternative.c b/arch/arm64/kernel/alternative.c
    index 5c4bce4ac381a..b9045d8d05d88 100644
    --- a/arch/arm64/kernel/alternative.c
    +++ b/arch/arm64/kernel/alternative.c
    @@ -47,11 +47,11 @@ static bool branch_insn_requires_update(struct alt_instr *alt, unsigned long pc)
    unsigned long replptr;

    if (kernel_text_address(pc))
    - return 1;
    + return true;

    replptr = (unsigned long)ALT_REPL_PTR(alt);
    if (pc >= replptr && pc <= (replptr + alt->alt_len))
    - return 0;
    + return false;

    /*
    * Branching into *another* alternate sequence is doomed, and
    --
    2.25.1


    \
     
     \ /
      Last update: 2020-07-20 19:10    [W:2.337 / U:0.100 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site