projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq
[oweals/u-boot.git]
/
include
/
linux
/
err.h
diff --git
a/include/linux/err.h
b/include/linux/err.h
index 5b3c8bcf700af26f88812491f0bf52b8a00537fa..5ede82432d2d26efeb0d402482f6483202db152d 100644
(file)
--- a/
include/linux/err.h
+++ b/
include/linux/err.h
@@
-4,7
+4,7
@@
#include <linux/compiler.h>
#include <linux/compat.h>
#include <linux/compiler.h>
#include <linux/compat.h>
-#include <
asm
/errno.h>
+#include <
linux
/errno.h>
/*
/*
@@
-23,17
+23,22
@@
static inline void *ERR_PTR(long error)
{
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)
{
}
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)
{
}
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_ERR(ptr));
}
/**
}
/**