Skip to contentSkip to conversation

Storage class should be first

PATCH In review Tobias Klauser 4 participants 4 messages May 28, 2006 – May 29, 2006

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Storage class should be first

Storage class should be before const

---

 arch/i386/kernel/machine_kexec.c       |    4 ++--
 arch/powerpc/kernel/machine_kexec_32.c |    4 ++--
 arch/ppc/kernel/machine_kexec.c        |    4 ++--
 arch/s390/kernel/machine_kexec.c       |    4 ++--
 arch/sh/kernel/machine_kexec.c         |    4 ++--
 arch/x86_64/kernel/machine_kexec.c     |    4 ++--
 drivers/media/video/pwc/pwc-kiara.h    |    4 ++--
 drivers/media/video/pwc/pwc-timon.h    |    4 ++--
 8 files changed, 16 insertions(+), 16 deletions(-)
arch/i386/kernel/machine_kexec.c +2 -2
diff -urpN -X dontdiff linux-2.6.17-rc5/arch/i386/kernel/machine_kexec.c linux-2.6.17-rc5~tk/arch/i386/kernel/machine_kexec.c
@@ -133,9 +133,9 @@ typedef asmlinkage NORET_TYPE void (*rel
 					unsigned long start_address,
 					unsigned int has_pae) ATTRIB_NORET;
 
-const extern unsigned char relocate_new_kernel[];
+extern const unsigned char relocate_new_kernel[];
 extern void relocate_new_kernel_end(void);
-const extern unsigned int relocate_new_kernel_size;
+extern const unsigned int relocate_new_kernel_size;
 
 /*
  * A architecture hook called to validate the
arch/powerpc/kernel/machine_kexec_32.c +2 -2
diff -urpN -X dontdiff linux-2.6.17-rc5/arch/powerpc/kernel/machine_kexec_32.c linux-2.6.17-rc5~tk/arch/powerpc/kernel/machine_kexec_32.c
@@ -30,8 +30,8 @@ typedef NORET_TYPE void (*relocate_new_k
  */
 void default_machine_kexec(struct kimage *image)
 {
-	const extern unsigned char relocate_new_kernel[];
-	const extern unsigned int relocate_new_kernel_size;
+	extern const unsigned char relocate_new_kernel[];
+	extern const unsigned int relocate_new_kernel_size;
 	unsigned long page_list;
 	unsigned long reboot_code_buffer, reboot_code_buffer_phys;
 	relocate_new_kernel_t rnk;
arch/ppc/kernel/machine_kexec.c +2 -2
diff -urpN -X dontdiff linux-2.6.17-rc5/arch/ppc/kernel/machine_kexec.c linux-2.6.17-rc5~tk/arch/ppc/kernel/machine_kexec.c
@@ -25,8 +25,8 @@ typedef NORET_TYPE void (*relocate_new_k
 				unsigned long reboot_code_buffer,
 				unsigned long start_address) ATTRIB_NORET;
 
-const extern unsigned char relocate_new_kernel[];
-const extern unsigned int relocate_new_kernel_size;
+extern const unsigned char relocate_new_kernel[];
+extern const unsigned int relocate_new_kernel_size;
 
 void machine_shutdown(void)
 {
arch/s390/kernel/machine_kexec.c +2 -2
diff -urpN -X dontdiff linux-2.6.17-rc5/arch/s390/kernel/machine_kexec.c linux-2.6.17-rc5~tk/arch/s390/kernel/machine_kexec.c
@@ -27,8 +27,8 @@ static void kexec_halt_all_cpus(void *);
 
 typedef void (*relocate_kernel_t) (kimage_entry_t *, unsigned long);
 
-const extern unsigned char relocate_kernel[];
-const extern unsigned long long relocate_kernel_len;
+extern const unsigned char relocate_kernel[];
+extern const unsigned long long relocate_kernel_len;
 
 int
 machine_kexec_prepare(struct kimage *image)
arch/sh/kernel/machine_kexec.c +2 -2
diff -urpN -X dontdiff linux-2.6.17-rc5/arch/sh/kernel/machine_kexec.c linux-2.6.17-rc5~tk/arch/sh/kernel/machine_kexec.c
@@ -25,8 +25,8 @@ typedef NORET_TYPE void (*relocate_new_k
 				unsigned long start_address,
 				unsigned long vbr_reg) ATTRIB_NORET;
 
-const extern unsigned char relocate_new_kernel[];
-const extern unsigned int relocate_new_kernel_size;
+extern const unsigned char relocate_new_kernel[];
+extern const unsigned int relocate_new_kernel_size;
 extern void *gdb_vbr_vector;
 
 /*
arch/x86_64/kernel/machine_kexec.c +2 -2
diff -urpN -X dontdiff linux-2.6.17-rc5/arch/x86_64/kernel/machine_kexec.c linux-2.6.17-rc5~tk/arch/x86_64/kernel/machine_kexec.c
@@ -149,8 +149,8 @@ typedef NORET_TYPE void (*relocate_new_k
 					unsigned long start_address,
 					unsigned long pgtable) ATTRIB_NORET;
 
-const extern unsigned char relocate_new_kernel[];
-const extern unsigned long relocate_new_kernel_size;
+extern const unsigned char relocate_new_kernel[];
+extern const unsigned long relocate_new_kernel_size;
 
 int machine_kexec_prepare(struct kimage *image)
 {
drivers/media/video/pwc/pwc-kiara.h +2 -2
diff -urpN -X dontdiff linux-2.6.17-rc5/drivers/media/video/pwc/pwc-kiara.h linux-2.6.17-rc5~tk/drivers/media/video/pwc/pwc-kiara.h
@@ -37,8 +37,8 @@ struct Kiara_table_entry
 	unsigned char mode[12];		/* precomputed mode settings for cam */
 };
 
-const extern struct Kiara_table_entry Kiara_table[PSZ_MAX][6][4];
-const extern unsigned int KiaraRomTable[8][2][16][8];
+extern const struct Kiara_table_entry Kiara_table[PSZ_MAX][6][4];
+extern const unsigned int KiaraRomTable[8][2][16][8];
 
 #endif
 
drivers/media/video/pwc/pwc-timon.h +2 -2
diff -urpN -X dontdiff linux-2.6.17-rc5/drivers/media/video/pwc/pwc-timon.h linux-2.6.17-rc5~tk/drivers/media/video/pwc/pwc-timon.h
@@ -52,8 +52,8 @@ struct Timon_table_entry
 	unsigned char mode[13];		/* precomputed mode settings for cam */
 };
 
-const extern struct Timon_table_entry Timon_table[PSZ_MAX][6][4];
-const extern unsigned int TimonRomTable [16][2][16][8];
+extern const struct Timon_table_entry Timon_table[PSZ_MAX][6][4];
+extern const unsigned int TimonRomTable [16][2][16][8];
 
 
 #endif

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#2 lore raw
In reply to Tobias Klauser

some compilers have problems (i remeber icc patches). ntl is is good practise to defne the storage class before anything else. Simply to help reading.

re,
wh

Quoted 6 lines · dan ost
Quoted 1 line · Tobias Klauser

Storage class should be before const

Is this a requirement of C that gcc is forgiving of or is this just good practice?

Quoted 9 lines

--Dan Ost

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#3 lore raw
In reply to Tobias Klauser
Quoted 5 lines · On Sun, 28 May 2006 13:18:07 -0500 dan ost wrote:
Quoted 1 line · Tobias Klauser

Storage class should be before const

Is this a requirement of C that gcc is forgiving of or is this just good practice?

Yes to both. It's deprecated ("obsolescent").

C99 spec, section 6.11.5:

6.11.5 Storage-class specifiers
The placement of a storage-class specifier other than at the beginning of the declaration specifiers in a declaration is an obsolescent feature.

---
~Randy
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors