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)

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Jaswinder Singh Rajput 2009-01-04 22:22:56 +05:30 committed by Ingo Molnar
parent a1d0272a46
commit 6c65da50bd
3 changed files with 41 additions and 42 deletions

View file

@ -40,16 +40,16 @@ struct intel_mp_floating {
#define MPC_SIGNATURE "PCMP" #define MPC_SIGNATURE "PCMP"
struct mpc_table { struct mpc_table {
char mpc_signature[4]; char signature[4];
unsigned short mpc_length; /* Size of table */ unsigned short length; /* Size of table */
char mpc_spec; /* 0x01 */ char spec; /* 0x01 */
char mpc_checksum; char checksum;
char mpc_oem[8]; char oem[8];
char mpc_productid[12]; char productid[12];
unsigned int mpc_oemptr; /* 0 if not present */ unsigned int oemptr; /* 0 if not present */
unsigned short mpc_oemsize; /* 0 if not present */ unsigned short oemsize; /* 0 if not present */
unsigned short mpc_oemcount; unsigned short oemcount;
unsigned int mpc_lapic; /* APIC address */ unsigned int lapic; /* APIC address */
unsigned int reserved; unsigned int reserved;
}; };

View file

@ -247,35 +247,35 @@ static void __init MP_lintsrc_info(struct mpc_lintsrc *m)
static int __init smp_check_mpc(struct mpc_table *mpc, char *oem, char *str) static int __init smp_check_mpc(struct mpc_table *mpc, char *oem, char *str)
{ {
if (memcmp(mpc->mpc_signature, MPC_SIGNATURE, 4)) { if (memcmp(mpc->signature, MPC_SIGNATURE, 4)) {
printk(KERN_ERR "MPTABLE: bad signature [%c%c%c%c]!\n", printk(KERN_ERR "MPTABLE: bad signature [%c%c%c%c]!\n",
mpc->mpc_signature[0], mpc->mpc_signature[1], mpc->signature[0], mpc->signature[1],
mpc->mpc_signature[2], mpc->mpc_signature[3]); mpc->signature[2], mpc->signature[3]);
return 0; return 0;
} }
if (mpf_checksum((unsigned char *)mpc, mpc->mpc_length)) { if (mpf_checksum((unsigned char *)mpc, mpc->length)) {
printk(KERN_ERR "MPTABLE: checksum error!\n"); printk(KERN_ERR "MPTABLE: checksum error!\n");
return 0; return 0;
} }
if (mpc->mpc_spec != 0x01 && mpc->mpc_spec != 0x04) { if (mpc->spec != 0x01 && mpc->spec != 0x04) {
printk(KERN_ERR "MPTABLE: bad table version (%d)!!\n", printk(KERN_ERR "MPTABLE: bad table version (%d)!!\n",
mpc->mpc_spec); mpc->spec);
return 0; return 0;
} }
if (!mpc->mpc_lapic) { if (!mpc->lapic) {
printk(KERN_ERR "MPTABLE: null local APIC address!\n"); printk(KERN_ERR "MPTABLE: null local APIC address!\n");
return 0; return 0;
} }
memcpy(oem, mpc->mpc_oem, 8); memcpy(oem, mpc->oem, 8);
oem[8] = 0; oem[8] = 0;
printk(KERN_INFO "MPTABLE: OEM ID: %s\n", oem); printk(KERN_INFO "MPTABLE: OEM ID: %s\n", oem);
memcpy(str, mpc->mpc_productid, 12); memcpy(str, mpc->productid, 12);
str[12] = 0; str[12] = 0;
printk(KERN_INFO "MPTABLE: Product ID: %s\n", str); printk(KERN_INFO "MPTABLE: Product ID: %s\n", str);
printk(KERN_INFO "MPTABLE: APIC at: 0x%X\n", mpc->mpc_lapic); printk(KERN_INFO "MPTABLE: APIC at: 0x%X\n", mpc->lapic);
return 1; return 1;
} }
@ -305,14 +305,14 @@ static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early)
#endif #endif
/* save the local APIC address, it might be non-default */ /* save the local APIC address, it might be non-default */
if (!acpi_lapic) if (!acpi_lapic)
mp_lapic_addr = mpc->mpc_lapic; mp_lapic_addr = mpc->lapic;
if (early) if (early)
return 1; return 1;
if (mpc->mpc_oemptr && x86_quirks->smp_read_mpc_oem) { if (mpc->oemptr && x86_quirks->smp_read_mpc_oem) {
struct mpc_oemtable *oem_table = (void *)(long)mpc->mpc_oemptr; struct mpc_oemtable *oem_table = (void *)(long)mpc->oemptr;
x86_quirks->smp_read_mpc_oem(oem_table, mpc->mpc_oemsize); x86_quirks->smp_read_mpc_oem(oem_table, mpc->oemsize);
} }
/* /*
@ -321,7 +321,7 @@ static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early)
if (x86_quirks->mpc_record) if (x86_quirks->mpc_record)
*x86_quirks->mpc_record = 0; *x86_quirks->mpc_record = 0;
while (count < mpc->mpc_length) { while (count < mpc->length) {
switch (*mpt) { switch (*mpt) {
case MP_PROCESSOR: case MP_PROCESSOR:
{ {
@ -378,8 +378,8 @@ static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early)
printk(KERN_ERR "Your mptable is wrong, contact your HW vendor!\n"); printk(KERN_ERR "Your mptable is wrong, contact your HW vendor!\n");
printk(KERN_ERR "type %x\n", *mpt); printk(KERN_ERR "type %x\n", *mpt);
print_hex_dump(KERN_ERR, " ", DUMP_PREFIX_ADDRESS, 16, print_hex_dump(KERN_ERR, " ", DUMP_PREFIX_ADDRESS, 16,
1, mpc, mpc->mpc_length, 1); 1, mpc, mpc->length, 1);
count = mpc->mpc_length; count = mpc->length;
break; break;
} }
if (x86_quirks->mpc_record) if (x86_quirks->mpc_record)
@ -848,8 +848,8 @@ static int __init replace_intsrc_all(struct mpc_table *mpc,
int count = sizeof(*mpc); int count = sizeof(*mpc);
unsigned char *mpt = ((unsigned char *)mpc) + count; unsigned char *mpt = ((unsigned char *)mpc) + count;
printk(KERN_INFO "mpc_length %x\n", mpc->mpc_length); printk(KERN_INFO "mpc_length %x\n", mpc->length);
while (count < mpc->mpc_length) { while (count < mpc->length) {
switch (*mpt) { switch (*mpt) {
case MP_PROCESSOR: case MP_PROCESSOR:
{ {
@ -912,7 +912,7 @@ static int __init replace_intsrc_all(struct mpc_table *mpc,
printk(KERN_ERR "Your mptable is wrong, contact your HW vendor!\n"); printk(KERN_ERR "Your mptable is wrong, contact your HW vendor!\n");
printk(KERN_ERR "type %x\n", *mpt); printk(KERN_ERR "type %x\n", *mpt);
print_hex_dump(KERN_ERR, " ", DUMP_PREFIX_ADDRESS, 16, print_hex_dump(KERN_ERR, " ", DUMP_PREFIX_ADDRESS, 16,
1, mpc, mpc->mpc_length, 1); 1, mpc, mpc->length, 1);
goto out; goto out;
} }
} }
@ -947,7 +947,7 @@ static int __init replace_intsrc_all(struct mpc_table *mpc,
} }
} }
assign_to_mpc_intsrc(&mp_irqs[i], m); assign_to_mpc_intsrc(&mp_irqs[i], m);
mpc->mpc_length = count; mpc->length = count;
mpt += sizeof(struct mpc_intsrc); mpt += sizeof(struct mpc_intsrc);
} }
print_mp_irq_info(&mp_irqs[i]); print_mp_irq_info(&mp_irqs[i]);
@ -955,9 +955,8 @@ static int __init replace_intsrc_all(struct mpc_table *mpc,
#endif #endif
out: out:
/* update checksum */ /* update checksum */
mpc->mpc_checksum = 0; mpc->checksum = 0;
mpc->mpc_checksum -= mpf_checksum((unsigned char *)mpc, mpc->checksum -= mpf_checksum((unsigned char *)mpc, mpc->length);
mpc->mpc_length);
return 0; return 0;
} }
@ -1029,7 +1028,7 @@ static int __init update_mp_table(void)
printk(KERN_INFO "mpf: %lx\n", virt_to_phys(mpf)); printk(KERN_INFO "mpf: %lx\n", virt_to_phys(mpf));
printk(KERN_INFO "mpf_physptr: %x\n", mpf->mpf_physptr); printk(KERN_INFO "mpf_physptr: %x\n", mpf->mpf_physptr);
if (mpc_new_phys && mpc->mpc_length > mpc_new_length) { if (mpc_new_phys && mpc->length > mpc_new_length) {
mpc_new_phys = 0; mpc_new_phys = 0;
printk(KERN_INFO "mpc_new_length is %ld, please use alloc_mptable=8k\n", printk(KERN_INFO "mpc_new_length is %ld, please use alloc_mptable=8k\n",
mpc_new_length); mpc_new_length);
@ -1038,10 +1037,10 @@ static int __init update_mp_table(void)
if (!mpc_new_phys) { if (!mpc_new_phys) {
unsigned char old, new; unsigned char old, new;
/* check if we can change the postion */ /* check if we can change the postion */
mpc->mpc_checksum = 0; mpc->checksum = 0;
old = mpf_checksum((unsigned char *)mpc, mpc->mpc_length); old = mpf_checksum((unsigned char *)mpc, mpc->length);
mpc->mpc_checksum = 0xff; mpc->checksum = 0xff;
new = mpf_checksum((unsigned char *)mpc, mpc->mpc_length); new = mpf_checksum((unsigned char *)mpc, mpc->length);
if (old == new) { if (old == new) {
printk(KERN_INFO "mpc is readonly, please try alloc_mptable instead\n"); printk(KERN_INFO "mpc is readonly, please try alloc_mptable instead\n");
return 0; return 0;
@ -1050,7 +1049,7 @@ static int __init update_mp_table(void)
} else { } else {
mpf->mpf_physptr = mpc_new_phys; mpf->mpf_physptr = mpc_new_phys;
mpc_new = phys_to_virt(mpc_new_phys); mpc_new = phys_to_virt(mpc_new_phys);
memcpy(mpc_new, mpc, mpc->mpc_length); memcpy(mpc_new, mpc, mpc->length);
mpc = mpc_new; mpc = mpc_new;
/* check if we can modify that */ /* check if we can modify that */
if (mpc_new_phys - mpf->mpf_physptr) { if (mpc_new_phys - mpf->mpf_physptr) {

View file

@ -46,9 +46,9 @@ static void __init enable_apic_mode(void)
static __init int static __init int
mps_oem_check(struct mpc_table *mpc, char *oem, char *productid) 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 *oem_table =
(struct mpc_oemtable *)mpc->mpc_oemptr; (struct mpc_oemtable *)mpc->oemptr;
if (!strncmp(oem, "UNISYS", 6)) if (!strncmp(oem, "UNISYS", 6))
return parse_unisys_oem((char *)oem_table); return parse_unisys_oem((char *)oem_table);
} }