summaryrefslogtreecommitdiff
path: root/include/linux/err.h
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-11-08 07:27:45 -0500
committerTom Rini <trini@konsulko.com>2019-11-08 07:27:45 -0500
commitee1c499851e0fda1a6ab98fb1f1d1f672e64a6f8 (patch)
tree732cd565e5a59da41e14bfb69c2f85889eb6d478 /include/linux/err.h
parent3f2d4bf462825c106ef7a06a16ec8d5c07ef8949 (diff)
parentfefff636337b53ac7fc1b0e9f38eb7b188bc0e60 (diff)
Merge branch '2019-11-07-master-imports'
- Add Phytium Durian Board - Assorted bugfixes - Allow for make ERR_PTR/PTR_ERR architecture specific
Diffstat (limited to 'include/linux/err.h')
-rw-r--r--include/linux/err.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/err.h b/include/linux/err.h
index 22e5756eddc..5ede82432d2 100644
--- a/include/linux/err.h
+++ b/include/linux/err.h
@@ -23,22 +23,22 @@
static inline void *ERR_PTR(long error)
{
- return (void *) error;
+ return (void *)(CONFIG_ERR_PTR_OFFSET + error);
}
static inline long PTR_ERR(const void *ptr)
{
- return (long) ptr;
+ return ((long)ptr - CONFIG_ERR_PTR_OFFSET);
}
static inline long IS_ERR(const void *ptr)
{
- return IS_ERR_VALUE((unsigned long)ptr);
+ return IS_ERR_VALUE((unsigned long)PTR_ERR(ptr));
}
static inline bool IS_ERR_OR_NULL(const void *ptr)
{
- return !ptr || IS_ERR_VALUE((unsigned long)ptr);
+ return !ptr || IS_ERR_VALUE((unsigned long)PTR_ERR(ptr));
}
/**