lkml.org 
[lkml]   [2021]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH linux-next] x86:uaccess: fix boolreturn.cocci warnings
    Date
    From: Jing Yangyang <jing.yangyang@zte.com.cn>

    ./arch/x86/include/asm/uaccess.h:477:9-10:WARNING:return of 0/1 in
    function 'user_access_begin' with return type bool

    Return statements in functions returning bool should use true/false
    instead of 1/0.

    Generated by: scripts/coccinelle/misc/boolreturn.cocci

    Reported-by: Zeal Robot <zealci@zte.com.cn>
    Signed-off-by: Jing Yangyang <jing.yangyang@zte.com.cn>
    ---
    arch/x86/include/asm/uaccess.h | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
    index c9fa7be..e3b6f4f 100644
    --- a/arch/x86/include/asm/uaccess.h
    +++ b/arch/x86/include/asm/uaccess.h
    @@ -474,9 +474,9 @@ static inline bool __chk_range_not_ok(unsigned long addr, unsigned long size, un
    static __must_check __always_inline bool user_access_begin(const void __user *ptr, size_t len)
    {
    if (unlikely(!access_ok(ptr,len)))
    - return 0;
    + return false;
    __uaccess_begin_nospec();
    - return 1;
    + return true;
    }
    #define user_access_begin(a,b) user_access_begin(a,b)
    #define user_access_end() __uaccess_end()
    --
    1.8.3.1

    \
     
     \ /
      Last update: 2021-08-24 09:20    [W:3.376 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site