diff options
Diffstat (limited to 'sys/ofed/include/linux/err.h')
-rw-r--r-- | sys/ofed/include/linux/err.h | 12 |
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_ */ |