diff options
author | Paul Walmsley <paul@pwsan.com> | 2011-09-14 05:52:14 +0400 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2011-09-15 01:44:14 +0400 |
commit | 91d92d6cc86c9390b891a96e12a452a644c3ad76 (patch) | |
tree | d0292fed0f15e6c1a28b52c0c75f2cb4a7f61101 /arch/arm/mach-omap2/id.c | |
parent | 1f1b0353aa3ba5dfc35641452484ea4158ee3c9c (diff) | |
download | linux-91d92d6cc86c9390b891a96e12a452a644c3ad76.tar.xz |
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) static void __init omap3_cpuinfo(void) { u8 rev = GET_OMAP_REVISION(); - char cpu_name[16], cpu_rev[16]; + const char *cpu_name, *cpu_rev; - /* OMAP3430 and OMAP3530 are assumed to be same. + /* + * OMAP3430 and OMAP3530 are assumed to be same. * * OMAP3525, OMAP3515 and OMAP3503 can be detected only based * on available features. Upon detection, update the CPU id * and CPU class bits. */ if (cpu_is_omap3630()) { - strcpy(cpu_name, "OMAP3630"); + cpu_name = "OMAP3630"; } else if (cpu_is_omap3517()) { - /* - * AM35xx devices - */ - if (omap3_has_sgx()) - strcpy(cpu_name, "AM3517"); - else - strcpy(cpu_name, "AM3505"); + /* AM35xx devices */ + cpu_name = (omap3_has_sgx()) ? "AM3517" : "AM3505"; } else if (cpu_is_ti816x()) { - strcpy(cpu_name, "TI816X"); + cpu_name = "TI816X"; } else if (omap3_has_iva() && omap3_has_sgx()) { /* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */ - strcpy(cpu_name, "OMAP3430/3530"); + cpu_name = "OMAP3430/3530"; } else if (omap3_has_iva()) { - strcpy(cpu_name, "OMAP3525"); + cpu_name = "OMAP3525"; } else if (omap3_has_sgx()) { - strcpy(cpu_name, "OMAP3515"); + cpu_name = "OMAP3515"; } else { - strcpy(cpu_name, "OMAP3503"); + cpu_name = "OMAP3503"; } if (cpu_is_omap3630() || cpu_is_ti816x()) { switch (rev) { case OMAP_REVBITS_00: - strcpy(cpu_rev, "1.0"); + cpu_rev = "1.0"; break; case OMAP_REVBITS_01: - strcpy(cpu_rev, "1.1"); + cpu_rev = "1.1"; break; case OMAP_REVBITS_02: /* FALLTHROUGH */ default: /* Use the latest known revision as default */ - strcpy(cpu_rev, "1.2"); + cpu_rev = "1.2"; } } else if (cpu_is_omap3505() || cpu_is_omap3517()) { switch (rev) { case OMAP_REVBITS_00: - strcpy(cpu_rev, "1.0"); + cpu_rev = "1.0"; break; case OMAP_REVBITS_01: /* FALLTHROUGH */ default: /* Use the latest known revision as default */ - strcpy(cpu_rev, "1.1"); + cpu_rev = "1.1"; } } else { switch (rev) { case OMAP_REVBITS_00: - strcpy(cpu_rev, "1.0"); + cpu_rev = "1.0"; break; case OMAP_REVBITS_01: - strcpy(cpu_rev, "2.0"); + cpu_rev = "2.0"; break; case OMAP_REVBITS_02: - strcpy(cpu_rev, "2.1"); + cpu_rev = "2.1"; break; case OMAP_REVBITS_03: - strcpy(cpu_rev, "3.0"); + cpu_rev = "3.0"; break; case OMAP_REVBITS_04: - strcpy(cpu_rev, "3.1"); + cpu_rev = "3.1"; break; case OMAP_REVBITS_05: /* FALLTHROUGH */ default: /* Use the latest known revision as default */ - strcpy(cpu_rev, "3.1.2"); + cpu_rev = "3.1.2"; } } |