diff options
author | Jaswinder Singh Rajput <jaswinder@infradead.org> | 2009-01-04 11:52:56 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-05 08:08:34 -0500 |
commit | 6c65da50bd4589b6b627d4842b8e6705a0ccaab5 (patch) | |
tree | dcbed07153dd111b6a7f59b0ff590c37d504d701 /arch/x86 | |
parent | a1d0272a4676460787bcd7352414e0286763968d (diff) |
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>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/include/asm/mpspec_def.h | 20 | ||||
-rw-r--r-- | arch/x86/kernel/mpparse.c | 59 | ||||
-rw-r--r-- | arch/x86/mach-generic/es7000.c | 4 |
3 files changed, 41 insertions, 42 deletions
diff --git a/arch/x86/include/asm/mpspec_def.h b/arch/x86/include/asm/mpspec_def.h index 6ea62ea2dc21..59568bc4767f 100644 --- a/arch/x86/include/asm/mpspec_def.h +++ b/arch/x86/include/asm/mpspec_def.h | |||
@@ -40,16 +40,16 @@ struct intel_mp_floating { | |||
40 | #define MPC_SIGNATURE "PCMP" | 40 | #define MPC_SIGNATURE "PCMP" |
41 | 41 | ||
42 | struct mpc_table { | 42 | struct mpc_table { |
43 | char mpc_signature[4]; | 43 | char signature[4]; |
44 | unsigned short mpc_length; /* Size of table */ | 44 | unsigned short length; /* Size of table */ |
45 | char mpc_spec; /* 0x01 */ | 45 | char spec; /* 0x01 */ |
46 | char mpc_checksum; | 46 | char checksum; |
47 | char mpc_oem[8]; | 47 | char oem[8]; |
48 | char mpc_productid[12]; | 48 | char productid[12]; |
49 | unsigned int mpc_oemptr; /* 0 if not present */ | 49 | unsigned int oemptr; /* 0 if not present */ |
50 | unsigned short mpc_oemsize; /* 0 if not present */ | 50 | unsigned short oemsize; /* 0 if not present */ |
51 | unsigned short mpc_oemcount; | 51 | unsigned short oemcount; |
52 | unsigned int mpc_lapic; /* APIC address */ | 52 | unsigned int lapic; /* APIC address */ |
53 | unsigned int reserved; | 53 | unsigned int reserved; |
54 | }; | 54 | }; |
55 | 55 | ||
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index d780ddddbc37..e6a9724fefc1 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c | |||
@@ -247,35 +247,35 @@ static void __init MP_lintsrc_info(struct mpc_lintsrc *m) | |||
247 | static int __init smp_check_mpc(struct mpc_table *mpc, char *oem, char *str) | 247 | static int __init smp_check_mpc(struct mpc_table *mpc, char *oem, char *str) |
248 | { | 248 | { |
249 | 249 | ||
250 | if (memcmp(mpc->mpc_signature, MPC_SIGNATURE, 4)) { | 250 | if (memcmp(mpc->signature, MPC_SIGNATURE, 4)) { |
251 | printk(KERN_ERR "MPTABLE: bad signature [%c%c%c%c]!\n", | 251 | printk(KERN_ERR "MPTABLE: bad signature [%c%c%c%c]!\n", |
252 | mpc->mpc_signature[0], mpc->mpc_signature[1], | 252 | mpc->signature[0], mpc->signature[1], |
253 | mpc->mpc_signature[2], mpc->mpc_signature[3]); | 253 | mpc->signature[2], mpc->signature[3]); |
254 | return 0; | 254 | return 0; |
255 | } | 255 | } |
256 | if (mpf_checksum((unsigned char *)mpc, mpc->mpc_length)) { | 256 | if (mpf_checksum((unsigned char *)mpc, mpc->length)) { |
257 | printk(KERN_ERR "MPTABLE: checksum error!\n"); | 257 | printk(KERN_ERR "MPTABLE: checksum error!\n"); |
258 | return 0; | 258 | return 0; |
259 | } | 259 | } |
260 | if (mpc->mpc_spec != 0x01 && mpc->mpc_spec != 0x04) { | 260 | if (mpc->spec != 0x01 && mpc->spec != 0x04) { |
261 | printk(KERN_ERR "MPTABLE: bad table version (%d)!!\n", | 261 | printk(KERN_ERR "MPTABLE: bad table version (%d)!!\n", |
262 | mpc->mpc_spec); | 262 | mpc->spec); |
263 | return 0; | 263 | return 0; |
264 | } | 264 | } |
265 | if (!mpc->mpc_lapic) { | 265 | if (!mpc->lapic) { |
266 | printk(KERN_ERR "MPTABLE: null local APIC address!\n"); | 266 | printk(KERN_ERR "MPTABLE: null local APIC address!\n"); |
267 | return 0; | 267 | return 0; |
268 | } | 268 | } |
269 | memcpy(oem, mpc->mpc_oem, 8); | 269 | memcpy(oem, mpc->oem, 8); |
270 | oem[8] = 0; | 270 | oem[8] = 0; |
271 | printk(KERN_INFO "MPTABLE: OEM ID: %s\n", oem); | 271 | printk(KERN_INFO "MPTABLE: OEM ID: %s\n", oem); |
272 | 272 | ||
273 | memcpy(str, mpc->mpc_productid, 12); | 273 | memcpy(str, mpc->productid, 12); |
274 | str[12] = 0; | 274 | str[12] = 0; |
275 | 275 | ||
276 | printk(KERN_INFO "MPTABLE: Product ID: %s\n", str); | 276 | printk(KERN_INFO "MPTABLE: Product ID: %s\n", str); |
277 | 277 | ||
278 | printk(KERN_INFO "MPTABLE: APIC at: 0x%X\n", mpc->mpc_lapic); | 278 | printk(KERN_INFO "MPTABLE: APIC at: 0x%X\n", mpc->lapic); |
279 | 279 | ||
280 | return 1; | 280 | return 1; |
281 | } | 281 | } |
@@ -305,14 +305,14 @@ static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early) | |||
305 | #endif | 305 | #endif |
306 | /* save the local APIC address, it might be non-default */ | 306 | /* save the local APIC address, it might be non-default */ |
307 | if (!acpi_lapic) | 307 | if (!acpi_lapic) |
308 | mp_lapic_addr = mpc->mpc_lapic; | 308 | mp_lapic_addr = mpc->lapic; |
309 | 309 | ||
310 | if (early) | 310 | if (early) |
311 | return 1; | 311 | return 1; |
312 | 312 | ||
313 | if (mpc->mpc_oemptr && x86_quirks->smp_read_mpc_oem) { | 313 | if (mpc->oemptr && x86_quirks->smp_read_mpc_oem) { |
314 | struct mpc_oemtable *oem_table = (void *)(long)mpc->mpc_oemptr; | 314 | struct mpc_oemtable *oem_table = (void *)(long)mpc->oemptr; |
315 | x86_quirks->smp_read_mpc_oem(oem_table, mpc->mpc_oemsize); | 315 | x86_quirks->smp_read_mpc_oem(oem_table, mpc->oemsize); |
316 | } | 316 | } |
317 | 317 | ||
318 | /* | 318 | /* |
@@ -321,7 +321,7 @@ static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early) | |||
321 | if (x86_quirks->mpc_record) | 321 | if (x86_quirks->mpc_record) |
322 | *x86_quirks->mpc_record = 0; | 322 | *x86_quirks->mpc_record = 0; |
323 | 323 | ||
324 | while (count < mpc->mpc_length) { | 324 | while (count < mpc->length) { |
325 | switch (*mpt) { | 325 | switch (*mpt) { |
326 | case MP_PROCESSOR: | 326 | case MP_PROCESSOR: |
327 | { | 327 | { |
@@ -378,8 +378,8 @@ static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early) | |||
378 | printk(KERN_ERR "Your mptable is wrong, contact your HW vendor!\n"); | 378 | printk(KERN_ERR "Your mptable is wrong, contact your HW vendor!\n"); |
379 | printk(KERN_ERR "type %x\n", *mpt); | 379 | printk(KERN_ERR "type %x\n", *mpt); |
380 | print_hex_dump(KERN_ERR, " ", DUMP_PREFIX_ADDRESS, 16, | 380 | print_hex_dump(KERN_ERR, " ", DUMP_PREFIX_ADDRESS, 16, |
381 | 1, mpc, mpc->mpc_length, 1); | 381 | 1, mpc, mpc->length, 1); |
382 | count = mpc->mpc_length; | 382 | count = mpc->length; |
383 | break; | 383 | break; |
384 | } | 384 | } |
385 | if (x86_quirks->mpc_record) | 385 | if (x86_quirks->mpc_record) |
@@ -848,8 +848,8 @@ static int __init replace_intsrc_all(struct mpc_table *mpc, | |||
848 | int count = sizeof(*mpc); | 848 | int count = sizeof(*mpc); |
849 | unsigned char *mpt = ((unsigned char *)mpc) + count; | 849 | unsigned char *mpt = ((unsigned char *)mpc) + count; |
850 | 850 | ||
851 | printk(KERN_INFO "mpc_length %x\n", mpc->mpc_length); | 851 | printk(KERN_INFO "mpc_length %x\n", mpc->length); |
852 | while (count < mpc->mpc_length) { | 852 | while (count < mpc->length) { |
853 | switch (*mpt) { | 853 | switch (*mpt) { |
854 | case MP_PROCESSOR: | 854 | case MP_PROCESSOR: |
855 | { | 855 | { |
@@ -912,7 +912,7 @@ static int __init replace_intsrc_all(struct mpc_table *mpc, | |||
912 | printk(KERN_ERR "Your mptable is wrong, contact your HW vendor!\n"); | 912 | printk(KERN_ERR "Your mptable is wrong, contact your HW vendor!\n"); |
913 | printk(KERN_ERR "type %x\n", *mpt); | 913 | printk(KERN_ERR "type %x\n", *mpt); |
914 | print_hex_dump(KERN_ERR, " ", DUMP_PREFIX_ADDRESS, 16, | 914 | print_hex_dump(KERN_ERR, " ", DUMP_PREFIX_ADDRESS, 16, |
915 | 1, mpc, mpc->mpc_length, 1); | 915 | 1, mpc, mpc->length, 1); |
916 | goto out; | 916 | goto out; |
917 | } | 917 | } |
918 | } | 918 | } |
@@ -947,7 +947,7 @@ static int __init replace_intsrc_all(struct mpc_table *mpc, | |||
947 | } | 947 | } |
948 | } | 948 | } |
949 | assign_to_mpc_intsrc(&mp_irqs[i], m); | 949 | assign_to_mpc_intsrc(&mp_irqs[i], m); |
950 | mpc->mpc_length = count; | 950 | mpc->length = count; |
951 | mpt += sizeof(struct mpc_intsrc); | 951 | mpt += sizeof(struct mpc_intsrc); |
952 | } | 952 | } |
953 | print_mp_irq_info(&mp_irqs[i]); | 953 | print_mp_irq_info(&mp_irqs[i]); |
@@ -955,9 +955,8 @@ static int __init replace_intsrc_all(struct mpc_table *mpc, | |||
955 | #endif | 955 | #endif |
956 | out: | 956 | out: |
957 | /* update checksum */ | 957 | /* update checksum */ |
958 | mpc->mpc_checksum = 0; | 958 | mpc->checksum = 0; |
959 | mpc->mpc_checksum -= mpf_checksum((unsigned char *)mpc, | 959 | mpc->checksum -= mpf_checksum((unsigned char *)mpc, mpc->length); |
960 | mpc->mpc_length); | ||
961 | 960 | ||
962 | return 0; | 961 | return 0; |
963 | } | 962 | } |
@@ -1029,7 +1028,7 @@ static int __init update_mp_table(void) | |||
1029 | printk(KERN_INFO "mpf: %lx\n", virt_to_phys(mpf)); | 1028 | printk(KERN_INFO "mpf: %lx\n", virt_to_phys(mpf)); |
1030 | printk(KERN_INFO "mpf_physptr: %x\n", mpf->mpf_physptr); | 1029 | printk(KERN_INFO "mpf_physptr: %x\n", mpf->mpf_physptr); |
1031 | 1030 | ||
1032 | if (mpc_new_phys && mpc->mpc_length > mpc_new_length) { | 1031 | if (mpc_new_phys && mpc->length > mpc_new_length) { |
1033 | mpc_new_phys = 0; | 1032 | mpc_new_phys = 0; |
1034 | printk(KERN_INFO "mpc_new_length is %ld, please use alloc_mptable=8k\n", | 1033 | printk(KERN_INFO "mpc_new_length is %ld, please use alloc_mptable=8k\n", |
1035 | mpc_new_length); | 1034 | mpc_new_length); |
@@ -1038,10 +1037,10 @@ static int __init update_mp_table(void) | |||
1038 | if (!mpc_new_phys) { | 1037 | if (!mpc_new_phys) { |
1039 | unsigned char old, new; | 1038 | unsigned char old, new; |
1040 | /* check if we can change the postion */ | 1039 | /* check if we can change the postion */ |
1041 | mpc->mpc_checksum = 0; | 1040 | mpc->checksum = 0; |
1042 | old = mpf_checksum((unsigned char *)mpc, mpc->mpc_length); | 1041 | old = mpf_checksum((unsigned char *)mpc, mpc->length); |
1043 | mpc->mpc_checksum = 0xff; | 1042 | mpc->checksum = 0xff; |
1044 | new = mpf_checksum((unsigned char *)mpc, mpc->mpc_length); | 1043 | new = mpf_checksum((unsigned char *)mpc, mpc->length); |
1045 | if (old == new) { | 1044 | if (old == new) { |
1046 | printk(KERN_INFO "mpc is readonly, please try alloc_mptable instead\n"); | 1045 | printk(KERN_INFO "mpc is readonly, please try alloc_mptable instead\n"); |
1047 | return 0; | 1046 | return 0; |
@@ -1050,7 +1049,7 @@ static int __init update_mp_table(void) | |||
1050 | } else { | 1049 | } else { |
1051 | mpf->mpf_physptr = mpc_new_phys; | 1050 | mpf->mpf_physptr = mpc_new_phys; |
1052 | mpc_new = phys_to_virt(mpc_new_phys); | 1051 | mpc_new = phys_to_virt(mpc_new_phys); |
1053 | memcpy(mpc_new, mpc, mpc->mpc_length); | 1052 | memcpy(mpc_new, mpc, mpc->length); |
1054 | mpc = mpc_new; | 1053 | mpc = mpc_new; |
1055 | /* check if we can modify that */ | 1054 | /* check if we can modify that */ |
1056 | if (mpc_new_phys - mpf->mpf_physptr) { | 1055 | if (mpc_new_phys - mpf->mpf_physptr) { |
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c index 39243a796e18..c2ded1448024 100644 --- a/arch/x86/mach-generic/es7000.c +++ b/arch/x86/mach-generic/es7000.c | |||
@@ -46,9 +46,9 @@ static void __init enable_apic_mode(void) | |||
46 | static __init int | 46 | static __init int |
47 | mps_oem_check(struct mpc_table *mpc, char *oem, char *productid) | 47 | mps_oem_check(struct mpc_table *mpc, char *oem, char *productid) |
48 | { | 48 | { |
49 | if (mpc->mpc_oemptr) { | 49 | if (mpc->oemptr) { |
50 | struct mpc_oemtable *oem_table = | 50 | struct mpc_oemtable *oem_table = |
51 | (struct mpc_oemtable *)mpc->mpc_oemptr; | 51 | (struct mpc_oemtable *)mpc->oemptr; |
52 | if (!strncmp(oem, "UNISYS", 6)) | 52 | if (!strncmp(oem, "UNISYS", 6)) |
53 | return parse_unisys_oem((char *)oem_table); | 53 | return parse_unisys_oem((char *)oem_table); |
54 | } | 54 | } |