提交 91d92d6c 编写于 作者: P Paul Walmsley

OMAP3: id: remove useless strcpy()s

omap3_cpuinfo() is filled with useless strcpy() calls; remove them.
Signed-off-by: NPaul Walmsley <paul@pwsan.com>
Cc: Sanjeev Premi <premi@ti.com>
Tested-by: NIgor Grinberg <grinberg@compulab.co.il>
Tested-by: NAbhilash Koyamangalath <abhilash.kv@ti.com>
上级 1f1b0353
......@@ -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";
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册