Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b8cbf3a7 authored by Nick Desaulniers's avatar Nick Desaulniers Committed by Gerrit - the friendly Code Review server
Browse files

srcu: Avoid escaped section names

The stringification operator, `#`, in the preprocessor escapes strings.
For example, `# "foo"` becomes `"\"foo\""`.  GCC and Clang differ in how
they treat section names that contain \".
The portable solution is to not use a string literal with the
preprocessor stringification operator.

Change-Id: I7ec44bd2ef15fa8019f2fa5efe2eddf40585ab5a
Link: https://bugs.llvm.org/show_bug.cgi?id=42950


Fixes: fe15b50c ("srcu: Allocate per-CPU data for DEFINE_SRCU() in modules")
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Reviewed-by: default avatarNathan Chancellor <natechancellor@gmail.com>
Tested-by: default avatarNathan Chancellor <natechancellor@gmail.com>
Reviewed-by: default avatarSedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
Git-commit: c1370c128cf49147f1d4c670b7101134231b3dc5
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


Signed-off-by: default avatarlixiang <lixiang@codeaurora.org>
parent 8336f3ed
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ struct srcu_struct {
# define __DEFINE_SRCU(name, is_static)					\
	is_static struct srcu_struct name;				\
	struct srcu_struct * const __srcu_struct_##name			\
		__section("___srcu_struct_ptrs") = &name
		__section(___srcu_struct_ptrs) = &name
#else
# define __DEFINE_SRCU(name, is_static)					\
	static DEFINE_PER_CPU(struct srcu_data, name##_srcu_data);	\