diff options
| author | Grant Likely <grant.likely@secretlab.ca> | 2011-01-14 12:09:49 -0700 |
|---|---|---|
| committer | Grant Likely <grant.likely@secretlab.ca> | 2011-01-14 12:09:49 -0700 |
| commit | 42a9fa9957e369240936891c9a521ab671eed4e7 (patch) | |
| tree | 7a9367594a367085c6a4a4433f687ec5c8dac8b7 /include/linux/kernel.h | |
| parent | 5f35765d836befebdfabf745fdbf2e070c887fac (diff) | |
| parent | c289ef41431144a538b5fb5f94fc83c81b3020e2 (diff) | |
Merge branch 'devicetree/next' into spi/next
Diffstat (limited to 'include/linux/kernel.h')
| -rw-r--r-- | include/linux/kernel.h | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index d0fbc043de60..5a9d9059520b 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -143,9 +143,22 @@ extern int _cond_resched(void); #define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0) -#define abs(x) ({ \ - long __x = (x); \ - (__x < 0) ? -__x : __x; \ +/* + * abs() handles unsigned and signed longs, ints, shorts and chars. For all + * input types abs() returns a signed long. + * abs() should not be used for 64-bit types (s64, u64, long long) - use abs64() + * for those. + */ +#define abs(x) ({ \ + long ret; \ + if (sizeof(x) == sizeof(long)) { \ + long __x = (x); \ + ret = (__x < 0) ? -__x : __x; \ + } else { \ + int __x = (x); \ + ret = (__x < 0) ? -__x : __x; \ + } \ + ret; \ }) #define abs64(x) ({ \ @@ -587,6 +600,13 @@ struct sysinfo { #define NUMA_BUILD 0 #endif +/* This helps us avoid #ifdef CONFIG_COMPACTION */ +#ifdef CONFIG_COMPACTION +#define COMPACTION_BUILD 1 +#else +#define COMPACTION_BUILD 0 +#endif + /* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */ #ifdef CONFIG_FTRACE_MCOUNT_RECORD # define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD |
