diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 5582410..753be99 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -208,6 +209,9 @@ extern int _cond_resched(void); */ #define abs(x) ({ \ long ret; \ + BUILD_BUG_ON_MSG( \ + sizeof(typeof(x)) > sizeof(long), \ + "abs() should not be used for 64-bit types - use abs64()");\ if (sizeof(x) == sizeof(long)) { \ long __x = (x); \ ret = (__x < 0) ? -__x : __x; \