diff options
Diffstat (limited to 'tools/include/linux/kernel.h')
| -rw-r--r-- | tools/include/linux/kernel.h | 24 | 
1 files changed, 3 insertions, 21 deletions
| diff --git a/tools/include/linux/kernel.h b/tools/include/linux/kernel.h index a7e54a08fb54..9701e8307db0 100644 --- a/tools/include/linux/kernel.h +++ b/tools/include/linux/kernel.h @@ -7,6 +7,7 @@  #include <assert.h>  #include <linux/build_bug.h>  #include <linux/compiler.h> +#include <linux/math.h>  #include <endian.h>  #include <byteswap.h> @@ -14,8 +15,6 @@  #define UINT_MAX	(~0U)  #endif -#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) -  #define PERF_ALIGN(x, a)	__PERF_ALIGN_MASK(x, (typeof(x))(a)-1)  #define __PERF_ALIGN_MASK(x, mask)	(((x)+(mask))&~(mask)) @@ -52,15 +51,6 @@  	_min1 < _min2 ? _min1 : _min2; })  #endif -#ifndef roundup -#define roundup(x, y) (                                \ -{                                                      \ -	const typeof(y) __y = y;		       \ -	(((x) + (__y - 1)) / __y) * __y;	       \ -}                                                      \ -) -#endif -  #ifndef BUG_ON  #ifdef NDEBUG  #define BUG_ON(cond) do { if (cond) {} } while (0) @@ -102,17 +92,9 @@ int vscnprintf(char *buf, size_t size, const char *fmt, va_list args);  int scnprintf(char * buf, size_t size, const char * fmt, ...);  int scnprintf_pad(char * buf, size_t size, const char * fmt, ...); +#ifndef ARRAY_SIZE  #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) - -/* - * This looks more complex than it should be. But we need to - * get the type for the ~ right in round_down (it needs to be - * as wide as the result!), and we want to evaluate the macro - * arguments just once each. - */ -#define __round_mask(x, y) ((__typeof__(x))((y)-1)) -#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1) -#define round_down(x, y) ((x) & ~__round_mask(x, y)) +#endif  #define current_gfp_context(k) 0  #define synchronize_rcu() |