]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Implement IS_ERR_OR_NULL() function.
authorhselasky <hselasky@FreeBSD.org>
Mon, 19 Oct 2015 12:00:52 +0000 (12:00 +0000)
committerhselasky <hselasky@FreeBSD.org>
Mon, 19 Oct 2015 12:00:52 +0000 (12:00 +0000)
Sponsored by: Mellanox Technologies

sys/ofed/include/linux/err.h

index fe6b71d2a84bbfd3759710f6fbc2273965f4c470..a08712a2975dc7905a43f91656b472fc8a040b44 100644 (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)
 {