mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
Compiler Attributes: always use the extra-underscores syntax
The attribute syntax optionally allows to surround attribute names with "__" in order to avoid collisions with macros of the same name (see https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html). This homogenizes all attributes to use the syntax with underscores. While there are currently only a handful of cases of some TUs defining macros like "error" which may collide with the attributes, this should prevent futures surprises. This has been done only for "standard" attributes supported by the major compilers. In other words, those of third-party tools (e.g. sparse, plugins...) have not been changed for the moment. Tested-by: Sedat Dilek <sedat.dilek@gmail.com> # on top of v4.19-rc5, clang 7 Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Reviewed-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
This commit is contained in:
parent
29efbc6aea
commit
5c67a52f3d
5 changed files with 33 additions and 33 deletions
|
@ -24,7 +24,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
|
|||
long ______r; \
|
||||
static struct ftrace_likely_data \
|
||||
__attribute__((__aligned__(4))) \
|
||||
__attribute__((section("_ftrace_annotated_branch"))) \
|
||||
__attribute__((__section__("_ftrace_annotated_branch"))) \
|
||||
______f = { \
|
||||
.data.func = __func__, \
|
||||
.data.file = __FILE__, \
|
||||
|
@ -60,7 +60,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
|
|||
int ______r; \
|
||||
static struct ftrace_branch_data \
|
||||
__attribute__((__aligned__(4))) \
|
||||
__attribute__((section("_ftrace_branch"))) \
|
||||
__attribute__((__section__("_ftrace_branch"))) \
|
||||
______f = { \
|
||||
.func = __func__, \
|
||||
.file = __FILE__, \
|
||||
|
@ -146,7 +146,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
|
|||
extern typeof(sym) sym; \
|
||||
static const unsigned long __kentry_##sym \
|
||||
__used \
|
||||
__attribute__((section("___kentry" "+" #sym ), used)) \
|
||||
__attribute__((__section__("___kentry" "+" #sym ), used)) \
|
||||
= (unsigned long)&sym;
|
||||
#endif
|
||||
|
||||
|
@ -287,7 +287,7 @@ unsigned long read_word_at_a_time(const void *addr)
|
|||
* visible to the compiler.
|
||||
*/
|
||||
#define __ADDRESSABLE(sym) \
|
||||
static void * __attribute__((section(".discard.addressable"), used)) \
|
||||
static void * __attribute__((__section__(".discard.addressable"), used)) \
|
||||
__PASTE(__addressable_##sym, __LINE__) = (void *)&sym;
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue