lkml.org 
[lkml]   [2017]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 19/21] tools include: add IS_ERR_OR_NULL to err.h
    Date
    Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
    ---
    tools/include/linux/err.h | 5 +++++
    1 file changed, 5 insertions(+)

    diff --git a/tools/include/linux/err.h b/tools/include/linux/err.h
    index bdc3dd8131d4..abf0478a8fb2 100644
    --- a/tools/include/linux/err.h
    +++ b/tools/include/linux/err.h
    @@ -46,4 +46,9 @@ static inline bool __must_check IS_ERR(__force const void *ptr)
    return IS_ERR_VALUE((unsigned long)ptr);
    }

    +static inline bool __must_check IS_ERR_OR_NULL(__force const void *ptr)
    +{
    + return unlikely(!ptr) || IS_ERR_VALUE((unsigned long)ptr);
    +}
    +
    #endif /* _LINUX_ERR_H */
    --
    2.11.0
    \
     
     \ /
      Last update: 2017-05-25 15:03    [W:4.298 / U:0.052 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site