Implement IS_ERR_OR_NULL() function.

Sponsored by:	Mellanox Technologies
This commit is contained in:
Hans Petter Selasky 2015-10-19 12:00:52 +00:00
parent 2404bdddf1
commit af5648c465

View File

@ -2,7 +2,7 @@
* Copyright (c) 2010 Isilon Systems, Inc.
* Copyright (c) 2010 iX Systems, Inc.
* Copyright (c) 2010 Panasas, Inc.
* Copyright (c) 2013, 2014 Mellanox Technologies, Ltd.
* Copyright (c) 2013-2015 Mellanox Technologies, Ltd.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -52,6 +52,12 @@ IS_ERR(const void *ptr)
return IS_ERR_VALUE((unsigned long)ptr);
}
static inline long
IS_ERR_OR_NULL(const void *ptr)
{
return !ptr || IS_ERR_VALUE((unsigned long)ptr);
}
static inline void *
ERR_CAST(void *ptr)
{