Skip to contentSkip to conversation

x86: rename all fields of mpc_table mpc_X to X

PATCH In review Jaswinder Singh Rajput 1 participant 2 messages Jan 4, 2009 x86

lore
Share & tools
lore
#0 lore raw

PATCH 7/7 x86: rename all fields of mpc_table mpc_X to X

Impact: cleanup, solve 80 columns wrap problems

It would be cleaner to rename all the mpc->mpc_X fields to mpc->X - that alone would give 4 characters per usage site. (we already know that it's an 'mpc' entity -
no need to duplicate that in the field too)

---
 arch/x86/include/asm/mpspec_def.h |   20 ++++++------
 arch/x86/kernel/mpparse.c         |   59 ++++++++++++++++++-------------------
 arch/x86/mach-generic/es7000.c    |    4 +-
 3 files changed, 41 insertions(+), 42 deletions(-)
arch/x86/include/asm/mpspec_def.h +10 -10
index 6ea62ea..59568bc 100644
@@ -40,16 +40,16 @@ struct intel_mp_floating {
 #define MPC_SIGNATURE "PCMP"
 
 struct mpc_table {
-	char mpc_signature[4];
-	unsigned short mpc_length;	/* Size of table */
-	char mpc_spec;			/* 0x01 */
-	char mpc_checksum;
-	char mpc_oem[8];
-	char mpc_productid[12];
-	unsigned int mpc_oemptr;	/* 0 if not present */
-	unsigned short mpc_oemsize;	/* 0 if not present */
-	unsigned short mpc_oemcount;
-	unsigned int mpc_lapic;	/* APIC address */
+	char signature[4];
+	unsigned short length;		/* Size of table */
+	char spec;			/* 0x01 */
+	char checksum;
+	char oem[8];
+	char productid[12];
+	unsigned int oemptr;		/* 0 if not present */
+	unsigned short oemsize;		/* 0 if not present */
+	unsigned short oemcount;
+	unsigned int lapic;		/* APIC address */
 	unsigned int reserved;
 };
 
arch/x86/kernel/mpparse.c +29 -30

148 lines not on this page · raw message

arch/x86/mach-generic/es7000.c +2 -2
index 39243a7..d7d80bb 100644
@@ -46,9 +46,9 @@ static void __init enable_apic_mode(void)
 static __init int
 mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
 {
-	if (mpc->mpc_oemptr) {
+	if (mpc-oemptr) {
 		struct mpc_oemtable *oem_table =
-			(struct mpc_oemtable *)mpc->mpc_oemptr;
+			(struct mpc_oemtable *)mpc->oemptr;
 		if (!strncmp(oem, "UNISYS", 6))
 			return parse_unisys_oem((char *)oem_table);
 	}
Signature · 1 line
1.5.5.1
#1 lore raw

Review

Quoted 5 lines · Jaswinder Singh Rajput

mps_oem_check(struct mpc_table *mpc, char *oem, char *productid) {

(quoted diff) +1 -1
-	if (mpc->mpc_oemptr) {
+	if (mpc-oemptr) {
 		struct mpc_oemtable *oem_table =

It seems that I need some sleep, Here is correct one:

Subject: [PATCH -tip 7/7] x86: rename all fields of mpc_table mpc_X to X

Impact: cleanup, solve 80 columns wrap problems

It would be cleaner to rename all the mpc->mpc_X fields to mpc->X - that alone would give 4 characters per usage site. (we already know that it's an 'mpc' entity -
no need to duplicate that in the field too)

---
 arch/x86/include/asm/mpspec_def.h |   20 ++++++------
 arch/x86/kernel/mpparse.c         |   59 ++++++++++++++++++-------------------
 arch/x86/mach-generic/es7000.c    |    4 +-
 3 files changed, 41 insertions(+), 42 deletions(-)
arch/x86/include/asm/mpspec_def.h +10 -10
index 6ea62ea..59568bc 100644
@@ -40,16 +40,16 @@ struct intel_mp_floating {
 #define MPC_SIGNATURE "PCMP"
 
 struct mpc_table {
-	char mpc_signature[4];
-	unsigned short mpc_length;	/* Size of table */
-	char mpc_spec;			/* 0x01 */
-	char mpc_checksum;
-	char mpc_oem[8];
-	char mpc_productid[12];
-	unsigned int mpc_oemptr;	/* 0 if not present */
-	unsigned short mpc_oemsize;	/* 0 if not present */
-	unsigned short mpc_oemcount;
-	unsigned int mpc_lapic;	/* APIC address */
+	char signature[4];
+	unsigned short length;		/* Size of table */
+	char spec;			/* 0x01 */
+	char checksum;
+	char oem[8];
+	char productid[12];
+	unsigned int oemptr;		/* 0 if not present */
+	unsigned short oemsize;		/* 0 if not present */
+	unsigned short oemcount;
+	unsigned int lapic;		/* APIC address */
 	unsigned int reserved;
 };
 
arch/x86/kernel/mpparse.c +29 -30

148 lines not on this page · raw message

arch/x86/mach-generic/es7000.c +2 -2
index 39243a7..c2ded14 100644
@@ -46,9 +46,9 @@ static void __init enable_apic_mode(void)
 static __init int
 mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
 {
-	if (mpc->mpc_oemptr) {
+	if (mpc->oemptr) {
 		struct mpc_oemtable *oem_table =
-			(struct mpc_oemtable *)mpc->mpc_oemptr;
+			(struct mpc_oemtable *)mpc->oemptr;
 		if (!strncmp(oem, "UNISYS", 6))
 			return parse_unisys_oem((char *)oem_table);
 	}
Signature · 1 line
1.5.5.1