x86/oprofile/nmi_int: add Nehalem to list of ppro cores

..otherwise oprofile will fall back on that poor timer interrupt.

Also replace the unreadable chain of if-statements with a "switch()"
statement instead. It generates better code, and is a lot clearer.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

+27 -13
+27 -13
arch/x86/oprofile/nmi_int.c
··· 369 369 { 370 370 __u8 cpu_model = boot_cpu_data.x86_model; 371 371 372 - if (cpu_model == 14) 373 - *cpu_type = "i386/core"; 374 - else if (cpu_model == 15 || cpu_model == 23) 375 - *cpu_type = "i386/core_2"; 376 - else if (cpu_model > 0xd) 377 - return 0; 378 - else if (cpu_model == 9) { 379 - *cpu_type = "i386/p6_mobile"; 380 - } else if (cpu_model > 5) { 381 - *cpu_type = "i386/piii"; 382 - } else if (cpu_model > 2) { 383 - *cpu_type = "i386/pii"; 384 - } else { 372 + switch (cpu_model) { 373 + case 0 ... 2: 385 374 *cpu_type = "i386/ppro"; 375 + break; 376 + case 3 ... 5: 377 + *cpu_type = "i386/pii"; 378 + break; 379 + case 6 ... 8: 380 + *cpu_type = "i386/piii"; 381 + break; 382 + case 9: 383 + *cpu_type = "i386/p6_mobile"; 384 + break; 385 + case 10 ... 13: 386 + *cpu_type = "i386/p6"; 387 + break; 388 + case 14: 389 + *cpu_type = "i386/core"; 390 + break; 391 + case 15: case 23: 392 + *cpu_type = "i386/core_2"; 393 + break; 394 + case 26: 395 + *cpu_type = "i386/core_2"; 396 + break; 397 + default: 398 + /* Unknown */ 399 + return 0; 386 400 } 387 401 388 402 model = &op_ppro_spec;