From af5648c465c3a5ba66d5ec3263b50488d894d0b6 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Mon, 19 Oct 2015 12:00:52 +0000 Subject: [PATCH] Implement IS_ERR_OR_NULL() function. Sponsored by: Mellanox Technologies --- sys/ofed/include/linux/err.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/ofed/include/linux/err.h b/sys/ofed/include/linux/err.h index fe6b71d2a84b..a08712a2975d 100644 --- a/sys/ofed/include/linux/err.h +++ b/sys/ofed/include/linux/err.h @@ -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) {