summaryrefslogtreecommitdiff
path: root/src/apk_defines.h
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2021-08-23 15:05:16 +0300
committerTimo Teräs <timo.teras@iki.fi>2021-08-23 17:02:50 +0300
commit72d8cb8937c5ffa7016ef3fdfeb17c5abae97b61 (patch)
treef0a16e94666c01a1b87bbe1b4ddbf94c90fae291 /src/apk_defines.h
parent91085a48742611182f08b0c83621641261bca850 (diff)
downloadapk-tools-72d8cb8937c5ffa7016ef3fdfeb17c5abae97b61.tar.gz
apk-tools-72d8cb8937c5ffa7016ef3fdfeb17c5abae97b61.tar.bz2
apk-tools-72d8cb8937c5ffa7016ef3fdfeb17c5abae97b61.tar.xz
apk-tools-72d8cb8937c5ffa7016ef3fdfeb17c5abae97b61.zip
remove IS_ERR_OR_NULL
In most places where pointer can be an 'error' it cannot be null pointer. Further, in those cases just calling PTR_ERR() is not enough to handle the null case. Simplify code by removing this case. If NULL case needs to be handled, it's better to add separate check and return fixed error code in that case.
Diffstat (limited to 'src/apk_defines.h')
-rw-r--r--src/apk_defines.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/apk_defines.h b/src/apk_defines.h
index 52fef0d..d98a28d 100644
--- a/src/apk_defines.h
+++ b/src/apk_defines.h
@@ -69,7 +69,6 @@ static inline void *ERR_PTR(long error) { return (void*) error; }
static inline void *ERR_CAST(const void *ptr) { return (void*) ptr; }
static inline int PTR_ERR(const void *ptr) { return (int)(long) ptr; }
static inline int IS_ERR(const void *ptr) { return (unsigned long)ptr >= (unsigned long)-4095; }
-static inline int IS_ERR_OR_NULL(const void *ptr) { return IS_ERR(ptr) || !ptr; }
#if defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ < 96
#define __builtin_expect(x, expected_value) (x)