summaryrefslogtreecommitdiffstats
path: root/sys/ofed/include/linux/err.h
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2014-09-04 20:12:36 +0000
committerhselasky <hselasky@FreeBSD.org>2014-09-04 20:12:36 +0000
commitec8cd58eaa7dce1497f70cbccb426548688b297a (patch)
tree23b0dc5ba6b006f74b06a4bc47467cfeb326038f /sys/ofed/include/linux/err.h
parent0475b83655c10a4792a79a97799741c84500ad44 (diff)
downloadFreeBSD-src-ec8cd58eaa7dce1497f70cbccb426548688b297a.zip
FreeBSD-src-ec8cd58eaa7dce1497f70cbccb426548688b297a.tar.gz
MFC r270710 and r270821:
- Update the OFED Linux Emulation layer as a preparation for a hardware driver update from Mellanox Technologies. - Remove empty files from the OFED Linux Emulation layer. - Fix compile warnings related to printf() and the "%lld" and "%llx" format specifiers. - Add some missing 2-clause BSD copyrights. - Add "Mellanox Technologies, Ltd." to list of copyright holders. - Add some new compatibility files. - Fix order of uninit in the mlx4ib module to avoid crash at unload using the new module_exit_order() function. Sponsored by: Mellanox Technologies
Diffstat (limited to 'sys/ofed/include/linux/err.h')
-rw-r--r--sys/ofed/include/linux/err.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/ofed/include/linux/err.h b/sys/ofed/include/linux/err.h
index 858931d..fe6b71d 100644
--- a/sys/ofed/include/linux/err.h
+++ b/sys/ofed/include/linux/err.h
@@ -2,6 +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.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -57,4 +58,15 @@ ERR_CAST(void *ptr)
return (void *)ptr;
}
+static inline int
+PTR_ERR_OR_ZERO(const void *ptr)
+{
+ if (IS_ERR(ptr))
+ return PTR_ERR(ptr);
+ else
+ return 0;
+}
+
+#define PTR_RET(p) PTR_ERR_OR_ZERO(p)
+
#endif /* _LINUX_ERR_H_ */
OpenPOWER on IntegriCloud