Skip to contentSkip to conversation

lib/debugobjects.c: move __initdata after name

PATCH Superseded Fabian Frederick 2 participants 4 messages May 24, 2014 – May 25, 2014

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 3/4 lib/debugobjects.c: move __initdata after name

Cc Josh Triplett <[email protected]>
Cc Andrew Morton <[email protected]>
---
 lib/debugobjects.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
lib/debugobjects.c +3 -3
index b628247..437a6b4 100644
@@ -791,7 +791,7 @@ struct self_test {
 	unsigned long	dummy2[3];
 };
 
-static __initdata struct debug_obj_descr descr_type_test;
+static struct debug_obj_descr descr_type_test __initdata;
 
 /*
  * fixup_init is called when:
@@ -915,7 +915,7 @@ out:
 	return res;
 }
 
-static __initdata struct debug_obj_descr descr_type_test = {
+static struct debug_obj_descr descr_type_test __initdata = {
 	.name			= "selftest",
 	.fixup_init		= fixup_init,
 	.fixup_activate		= fixup_activate,
@@ -923,7 +923,7 @@ static __initdata struct debug_obj_descr descr_type_test = {
 	.fixup_free		= fixup_free,
 };
 
-static __initdata struct self_test obj = { .static_init = 0 };
+static struct self_test obj __initdata = { .static_init = 0 };
 
 static void __init debug_objects_selftest(void)
 {
Signature · 1 line
1.8.4.5
#1 lore raw
Quoted 3 lines · Fabian Frederick
Cc Josh Triplett <[email protected]>
Cc Andrew Morton <[email protected]>

No, don't make this change. A quick "git grep __initdata" shows that to the extent it has a consistent placement, it's either right after the type ("static some_type __initdata varname") or right after the storage class ("static __initdata some_type varname"). Other similar qualifiers follow the same pattern.

Quoted 37 lines
 lib/debugobjects.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
lib/debugobjects.c +3 -3
index b628247..437a6b4 100644
@@ -791,7 +791,7 @@ struct self_test {
 	unsigned long	dummy2[3];
 };
 
-static __initdata struct debug_obj_descr descr_type_test;
+static struct debug_obj_descr descr_type_test __initdata;
 
 /*
  * fixup_init is called when:
@@ -915,7 +915,7 @@ out:
 	return res;
 }
 
-static __initdata struct debug_obj_descr descr_type_test = {
+static struct debug_obj_descr descr_type_test __initdata = {
 	.name			= "selftest",
 	.fixup_init		= fixup_init,
 	.fixup_activate		= fixup_activate,
@@ -923,7 +923,7 @@ static __initdata struct debug_obj_descr descr_type_test = {
 	.fixup_free		= fixup_free,
 };
 
-static __initdata struct self_test obj = { .static_init = 0 };
+static struct self_test obj __initdata = { .static_init = 0 };
 
 static void __init debug_objects_selftest(void)
 {
Signature · 1 line
1.8.4.5
#2 lore raw
Quoted 10 lines · On Sat, 24 May 2014 14:56:35 -0700 Josh Triplett <[email protected]> wrote:
Quoted 3 lines · Fabian Frederick
Cc Josh Triplett <[email protected]>
Cc Andrew Morton <[email protected]>

No, don't make this change. A quick "git grep __initdata" shows that to the extent it has a consistent placement, it's either right after the type ("static some_type __initdata varname") or right after the storage class ("static __initdata some_type varname"). Other similar qualifiers follow the same pattern.

It was another checkpatch warning asking to put __initdata after variable name...

#3 lore raw

Adding Andy and Joe to CC.

Quoted 8 lines · Fabian Frederick
Quoted 5 lines · On Sat, 24 May 2014 14:56:35 -0700 Josh Triplett <[email protected]> wrote:
Quoted 3 lines · Fabian Frederick
Cc Josh Triplett <[email protected]>
Cc Andrew Morton <[email protected]>
Quoted 7 lines
Quoted 5 lines

No, don't make this change. A quick "git grep __initdata" shows that to the extent it has a consistent placement, it's either right after the type ("static some_type __initdata varname") or right after the storage class ("static __initdata some_type varname"). Other similar qualifiers follow the same pattern.

It was another checkpatch warning asking to put __initdata after variable name...

Gah. That warning should not exist. Looks like it got added in 8716de383b82f16d920513138f1691e40ef5a9e3 ("checkpatch: add test for positional misuse of section specifiers like __initdata"). The error for placement that GCC doesn't understand seems perfectly fine, but checkpatch should *not* complain about "static __initdata struct foo ..."; that's perfectly understandable, and the order the majority of the kernel uses. Please get rid of that warning, and just keep the error for the case GCC doesn't understand.

- Josh Triplett