diff options
| author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2015-11-05 18:45:02 -0800 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-12-18 17:22:00 +0100 |
| commit | e519a84b4370616f997aeef96ecb7d53ac5a3946 (patch) | |
| tree | 4093e4fdd90bbfdb75ffe630b5f28d6c72a373dd /include/linux/compiler.h | |
| parent | b0108db790152d206de8ca95c65061f85f910424 (diff) | |
compiler.h: add support for function attribute assume_aligned
gcc 4.9 added the function attribute assume_aligned, indicating to the
caller that the returned pointer may be assumed to have a certain minimal
alignment. This is useful if, for example, the return value is passed to
memset(). Add a shorthand macro for that.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Christoph Lameter <cl@linux.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Diffstat (limited to 'include/linux/compiler.h')
| -rw-r--r-- | include/linux/compiler.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index c6d06e91f..9dfaa48df 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -371,6 +371,14 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s #define __visible #endif +/* + * Assume alignment of return value. + */ +#ifndef __assume_aligned +#define __assume_aligned(a, ...) +#endif + + /* Are two types/vars the same type (ignoring qualifiers)? */ #ifndef __same_type # define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) |
