diff options
author | Paul Walmsley <paul@pwsan.com> | 2011-09-13 21:52:14 -0400 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2011-09-14 17:44:14 -0400 |
commit | 91d92d6cc86c9390b891a96e12a452a644c3ad76 (patch) | |
tree | d0292fed0f15e6c1a28b52c0c75f2cb4a7f61101 /arch/arm/mach-omap2/id.c | |
parent | 1f1b0353aa3ba5dfc35641452484ea4158ee3c9c (diff) |
OMAP3: id: remove useless strcpy()s
omap3_cpuinfo() is filled with useless strcpy() calls; remove them.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Sanjeev Premi <premi@ti.com>
Tested-by: Igor Grinberg <grinberg@compulab.co.il>
Tested-by: Abhilash Koyamangalath <abhilash.kv@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/id.c')
-rw-r--r-- | arch/arm/mach-omap2/id.c | 48 |
1 files changed, 22 insertions, 26 deletions
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index 3f3f998c89e0..9fae4de824e1 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c | |||
@@ -429,84 +429,80 @@ static void __init omap4_check_revision(void) | |||
429 | static void __init omap3_cpuinfo(void) | 429 | static void __init omap3_cpuinfo(void) |
430 | { | 430 | { |
431 | u8 rev = GET_OMAP_REVISION(); | 431 | u8 rev = GET_OMAP_REVISION(); |
432 | char cpu_name[16], cpu_rev[16]; | 432 | const char *cpu_name, *cpu_rev; |
433 | 433 | ||
434 | /* OMAP3430 and OMAP3530 are assumed to be same. | 434 | /* |
435 | * OMAP3430 and OMAP3530 are assumed to be same. | ||
435 | * | 436 | * |
436 | * OMAP3525, OMAP3515 and OMAP3503 can be detected only based | 437 | * OMAP3525, OMAP3515 and OMAP3503 can be detected only based |
437 | * on available features. Upon detection, update the CPU id | 438 | * on available features. Upon detection, update the CPU id |
438 | * and CPU class bits. | 439 | * and CPU class bits. |
439 | */ | 440 | */ |
440 | if (cpu_is_omap3630()) { | 441 | if (cpu_is_omap3630()) { |
441 | strcpy(cpu_name, "OMAP3630"); | 442 | cpu_name = "OMAP3630"; |
442 | } else if (cpu_is_omap3517()) { | 443 | } else if (cpu_is_omap3517()) { |
443 | /* | 444 | /* AM35xx devices */ |
444 | * AM35xx devices | 445 | cpu_name = (omap3_has_sgx()) ? "AM3517" : "AM3505"; |
445 | */ | ||
446 | if (omap3_has_sgx()) | ||
447 | strcpy(cpu_name, "AM3517"); | ||
448 | else | ||
449 | strcpy(cpu_name, "AM3505"); | ||
450 | } else if (cpu_is_ti816x()) { | 446 | } else if (cpu_is_ti816x()) { |
451 | strcpy(cpu_name, "TI816X"); | 447 | cpu_name = "TI816X"; |
452 | } else if (omap3_has_iva() && omap3_has_sgx()) { | 448 | } else if (omap3_has_iva() && omap3_has_sgx()) { |
453 | /* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */ | 449 | /* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */ |
454 | strcpy(cpu_name, "OMAP3430/3530"); | 450 | cpu_name = "OMAP3430/3530"; |
455 | } else if (omap3_has_iva()) { | 451 | } else if (omap3_has_iva()) { |
456 | strcpy(cpu_name, "OMAP3525"); | 452 | cpu_name = "OMAP3525"; |
457 | } else if (omap3_has_sgx()) { | 453 | } else if (omap3_has_sgx()) { |
458 | strcpy(cpu_name, "OMAP3515"); | 454 | cpu_name = "OMAP3515"; |
459 | } else { | 455 | } else { |
460 | strcpy(cpu_name, "OMAP3503"); | 456 | cpu_name = "OMAP3503"; |
461 | } | 457 | } |
462 | 458 | ||
463 | if (cpu_is_omap3630() || cpu_is_ti816x()) { | 459 | if (cpu_is_omap3630() || cpu_is_ti816x()) { |
464 | switch (rev) { | 460 | switch (rev) { |
465 | case OMAP_REVBITS_00: | 461 | case OMAP_REVBITS_00: |
466 | strcpy(cpu_rev, "1.0"); | 462 | cpu_rev = "1.0"; |
467 | break; | 463 | break; |
468 | case OMAP_REVBITS_01: | 464 | case OMAP_REVBITS_01: |
469 | strcpy(cpu_rev, "1.1"); | 465 | cpu_rev = "1.1"; |
470 | break; | 466 | break; |
471 | case OMAP_REVBITS_02: | 467 | case OMAP_REVBITS_02: |
472 | /* FALLTHROUGH */ | 468 | /* FALLTHROUGH */ |
473 | default: | 469 | default: |
474 | /* Use the latest known revision as default */ | 470 | /* Use the latest known revision as default */ |
475 | strcpy(cpu_rev, "1.2"); | 471 | cpu_rev = "1.2"; |
476 | } | 472 | } |
477 | } else if (cpu_is_omap3505() || cpu_is_omap3517()) { | 473 | } else if (cpu_is_omap3505() || cpu_is_omap3517()) { |
478 | switch (rev) { | 474 | switch (rev) { |
479 | case OMAP_REVBITS_00: | 475 | case OMAP_REVBITS_00: |
480 | strcpy(cpu_rev, "1.0"); | 476 | cpu_rev = "1.0"; |
481 | break; | 477 | break; |
482 | case OMAP_REVBITS_01: | 478 | case OMAP_REVBITS_01: |
483 | /* FALLTHROUGH */ | 479 | /* FALLTHROUGH */ |
484 | default: | 480 | default: |
485 | /* Use the latest known revision as default */ | 481 | /* Use the latest known revision as default */ |
486 | strcpy(cpu_rev, "1.1"); | 482 | cpu_rev = "1.1"; |
487 | } | 483 | } |
488 | } else { | 484 | } else { |
489 | switch (rev) { | 485 | switch (rev) { |
490 | case OMAP_REVBITS_00: | 486 | case OMAP_REVBITS_00: |
491 | strcpy(cpu_rev, "1.0"); | 487 | cpu_rev = "1.0"; |
492 | break; | 488 | break; |
493 | case OMAP_REVBITS_01: | 489 | case OMAP_REVBITS_01: |
494 | strcpy(cpu_rev, "2.0"); | 490 | cpu_rev = "2.0"; |
495 | break; | 491 | break; |
496 | case OMAP_REVBITS_02: | 492 | case OMAP_REVBITS_02: |
497 | strcpy(cpu_rev, "2.1"); | 493 | cpu_rev = "2.1"; |
498 | break; | 494 | break; |
499 | case OMAP_REVBITS_03: | 495 | case OMAP_REVBITS_03: |
500 | strcpy(cpu_rev, "3.0"); | 496 | cpu_rev = "3.0"; |
501 | break; | 497 | break; |
502 | case OMAP_REVBITS_04: | 498 | case OMAP_REVBITS_04: |
503 | strcpy(cpu_rev, "3.1"); | 499 | cpu_rev = "3.1"; |
504 | break; | 500 | break; |
505 | case OMAP_REVBITS_05: | 501 | case OMAP_REVBITS_05: |
506 | /* FALLTHROUGH */ | 502 | /* FALLTHROUGH */ |
507 | default: | 503 | default: |
508 | /* Use the latest known revision as default */ | 504 | /* Use the latest known revision as default */ |
509 | strcpy(cpu_rev, "3.1.2"); | 505 | cpu_rev = "3.1.2"; |
510 | } | 506 | } |
511 | } | 507 | } |
512 | 508 | ||