From b798c0adada182f69ccefdba4c8c04fbd92943be Mon Sep 17 00:00:00 2001 From: Juan Manuel Cruz Date: Thu, 26 Nov 2015 11:53:53 -0600 Subject: [PATCH] devices: _PASTE macro relocated from init.h to common.h The _PASTE and _PASTE2 macros are relocated from init.h (device handling) to toolchain/common.h for better reuse. _PASTE and PASTE_2 macro are renamed to _CONCAT and _DO_CONCAT. These names are more descriptive. Change-Id: Ie2f5b0cba1f1179eb3fb5ec00236a75a73267f98 Signed-off-by: Juan Manuel Cruz --- include/init.h | 6 +----- include/toolchain/common.h | 3 +++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/init.h b/include/init.h index 86373e38ab4..fe3ed29b7dd 100644 --- a/include/init.h +++ b/include/init.h @@ -97,10 +97,6 @@ * * @return A pointer to the device object created by SYS_DEFINE_DEVICE() */ - -#define _PASTE2(a, b) a##b -#define _PASTE(a, b) _PASTE2(a, b) - -#define SYS_GET_DEVICE(name) (&(_PASTE(__initconfig_, name))) +#define SYS_GET_DEVICE(name) (&(_CONCAT(__initconfig_, name))) #endif /* _INIT_H_ */ diff --git a/include/toolchain/common.h b/include/toolchain/common.h index b23b6e95b3e..ea2dc61da53 100644 --- a/include/toolchain/common.h +++ b/include/toolchain/common.h @@ -111,3 +111,6 @@ #define __stack __aligned(STACK_ALIGN) +/* concatenate the values of the arguments into one */ +#define _DO_CONCAT(x, y) x ## y +#define _CONCAT(x, y) _DO_CONCAT(x, y)