diff options
author | hselasky <hselasky@FreeBSD.org> | 2015-10-19 12:00:52 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2015-10-19 12:00:52 +0000 |
commit | 5daa6ae96ec66d044eba9b16f4291832d332daee (patch) | |
tree | 17259e22aee2e6056cf05fd8bc1abd09c45e50fd /sys/ofed | |
parent | c454e1ce47b34657966820a515ee21f60541fea5 (diff) | |
download | FreeBSD-src-5daa6ae96ec66d044eba9b16f4291832d332daee.zip FreeBSD-src-5daa6ae96ec66d044eba9b16f4291832d332daee.tar.gz |
Implement IS_ERR_OR_NULL() function.
Sponsored by: Mellanox Technologies
Diffstat (limited to 'sys/ofed')
-rw-r--r-- | sys/ofed/include/linux/err.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/ofed/include/linux/err.h b/sys/ofed/include/linux/err.h index fe6b71d..a08712a 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) { |