summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-05-28 02:03:22 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2016-05-28 02:03:22 +0300
commitaa00edc1287a693eadc7bc67a3d73555d969b35d (patch)
tree6dd91f62751407ea50e64c37f7e8a09bde803134 /include
parent5d22fc25d4fc8096d2d7df27ea1893d4e055e764 (diff)
downloadlinux-aa00edc1287a693eadc7bc67a3d73555d969b35d.tar.xz
make IS_ERR_VALUE() complain about non-pointer-sized arguments
Now that the allmodconfig x86-64 build is clean wrt IS_ERR_VALUE() uses on integers, add a cast to a pointer and back to the argument, so that any new mis-uses of IS_ERR_VALUE() will cause warnings like warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] so that we don't re-introduce any bogus uses. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/err.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/err.h b/include/linux/err.h
index 56762ab41713..1e3558845e4c 100644
--- a/include/linux/err.h
+++ b/include/linux/err.h
@@ -18,7 +18,7 @@
#ifndef __ASSEMBLY__
-#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)
+#define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO)
static inline void * __must_check ERR_PTR(long error)
{