aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kernel.h
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2015-11-23 03:04:05 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-11-23 03:04:05 -0500
commit92907cbbef8625bb3998d1eb385fc88f23c97a3f (patch)
tree15626ff9287e37c3cb81c7286d6db5a7fd77c854 /include/linux/kernel.h
parent15fbfccfe92c62ae8d1ecc647c44157ed01ac02e (diff)
parent1ec218373b8ebda821aec00bb156a9c94fad9cd4 (diff)
Merge tag 'v4.4-rc2' into drm-intel-next-queued
Linux 4.4-rc2 Backmerge to get at commit 1b0e3a049efe471c399674fd954500ce97438d30 Author: Imre Deak <imre.deak@intel.com> Date: Thu Nov 5 23:04:11 2015 +0200 drm/i915/skl: disable display side power well support for now so that we can proplery re-eanble skl power wells in -next. Conflicts are just adjacent lines changed, except for intel_fbdev.c where we need to interleave the changs. Nothing nefarious. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r--include/linux/kernel.h44
1 files changed, 23 insertions, 21 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 5582410727cb..350dfb08aee3 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -200,28 +200,28 @@ extern int _cond_resched(void);
200 200
201#define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0) 201#define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0)
202 202
203/* 203/**
204 * abs() handles unsigned and signed longs, ints, shorts and chars. For all 204 * abs - return absolute value of an argument
205 * input types abs() returns a signed long. 205 * @x: the value. If it is unsigned type, it is converted to signed type first
206 * abs() should not be used for 64-bit types (s64, u64, long long) - use abs64() 206 * (s64, long or int depending on its size).
207 * for those. 207 *
208 * Return: an absolute value of x. If x is 64-bit, macro's return type is s64,
209 * otherwise it is signed long.
208 */ 210 */
209#define abs(x) ({ \ 211#define abs(x) __builtin_choose_expr(sizeof(x) == sizeof(s64), ({ \
210 long ret; \ 212 s64 __x = (x); \
211 if (sizeof(x) == sizeof(long)) { \ 213 (__x < 0) ? -__x : __x; \
212 long __x = (x); \ 214 }), ({ \
213 ret = (__x < 0) ? -__x : __x; \ 215 long ret; \
214 } else { \ 216 if (sizeof(x) == sizeof(long)) { \
215 int __x = (x); \ 217 long __x = (x); \
216 ret = (__x < 0) ? -__x : __x; \ 218 ret = (__x < 0) ? -__x : __x; \
217 } \ 219 } else { \
218 ret; \ 220 int __x = (x); \
219 }) 221 ret = (__x < 0) ? -__x : __x; \
220 222 } \
221#define abs64(x) ({ \ 223 ret; \
222 s64 __x = (x); \ 224 }))
223 (__x < 0) ? -__x : __x; \
224 })
225 225
226/** 226/**
227 * reciprocal_scale - "scale" a value into range [0, ep_ro) 227 * reciprocal_scale - "scale" a value into range [0, ep_ro)
@@ -413,6 +413,8 @@ extern __printf(2, 3)
413char *kasprintf(gfp_t gfp, const char *fmt, ...); 413char *kasprintf(gfp_t gfp, const char *fmt, ...);
414extern __printf(2, 0) 414extern __printf(2, 0)
415char *kvasprintf(gfp_t gfp, const char *fmt, va_list args); 415char *kvasprintf(gfp_t gfp, const char *fmt, va_list args);
416extern __printf(2, 0)
417const char *kvasprintf_const(gfp_t gfp, const char *fmt, va_list args);
416 418
417extern __scanf(2, 3) 419extern __scanf(2, 3)
418int sscanf(const char *, const char *, ...); 420int sscanf(const char *, const char *, ...);