Messages in this thread Patch in this message | | | Date | Mon, 27 May 2002 22:29:25 -0300 | From | Arnaldo Carvalho de Melo <> | Subject | Re: [PATCH][RFC] PentiumPro/II split in x86 config |
| |
Em Mon, May 27, 2002 at 11:59:11PM +0200, J.A. Magallon escreveu: > Opps... typo. > Yes: > > { X86_VENDOR_INTEL, 6, > { "Pentium Pro A-step", "Pentium Pro", NULL, "Pentium II (Klamath)", > NULL, "Pentium II (Deschutes)", "Mobile Pentium II", > "Pentium III (Katmai)", "Pentium III (Coppermine)", NULL, > "Pentium III (Cascades)", NULL, NULL, NULL, NULL }}, > > Corrected patch on the way...
Hi,
Since you're working on this could I suggest that you use labeled elements, this gccism make the initialization above way more cleaner, safer and easy to read :-) This is being used in the kernel in places like the FSes, the TCP/IP stack and lots of other places.
We don't need all the NULLs, as uninitialized entries will be zeroed out by the compiler.
Here is how it would look like:
--- 1.50/arch/i386/kernel/setup.c Sat Apr 27 14:47:46 2002 +++ edited/arch/i386/kernel/setup.c Mon May 27 22:03:35 2002 @@ -2245,15 +2245,34 @@ /* This table only is used unless init_<vendor>() below doesn't set it; */ /* in particular, if CPUID levels 0x80000002..4 are supported, this isn't used */ static struct cpu_model_info cpu_models[] __initdata = { - { X86_VENDOR_INTEL, 4, - { "486 DX-25/33", "486 DX-50", "486 SX", "486 DX/2", "486 SL", - "486 SX/2", NULL, "486 DX/2-WB", "486 DX/4", "486 DX/4-WB", NULL, - NULL, NULL, NULL, NULL, NULL }}, - { X86_VENDOR_INTEL, 5, - { "Pentium 60/66 A-step", "Pentium 60/66", "Pentium 75 - 200", - "OverDrive PODP5V83", "Pentium MMX", NULL, NULL, - "Mobile Pentium 75 - 200", "Mobile Pentium MMX", NULL, NULL, NULL, - NULL, NULL, NULL, NULL }}, + { + vendor: X86_VENDOR_INTEL, + family: 4, + model_names: { + [0] = "486 DX-25/33", + [1] = "486 DX-50", + [2] = "486 SX", + [3] = "486 DX/2", + [4] = "486 SL", + [5] = "486 SX/2", + [7] = "486 DX/2-WB", + [8] = "486 DX/4", + [9] = "486 DX/4-WB", + }, + }, + { + vendor: X86_VENDOR_INTEL, + family: 5, + model_names: { + [0] = "Pentium 60/66 A-step", + [1] = "Pentium 60/66", + [2] = "Pentium 75 - 200", + [3] = "OverDrive PODP5V83", + [4] = "Pentium MMX", + [7] = "Mobile Pentium 75 - 200", + [8] = "Mobile Pentium MMX", + } + }, { X86_VENDOR_INTEL, 6, { "Pentium Pro A-step", "Pentium Pro", NULL, "Pentium II (Klamath)", NULL, "Pentium II (Deschutes)", "Mobile Pentium II", Best Regards,
- Arnaldo, with the janitor hat on for the time being 8) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |