mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-10-11 07:31:34 +02:00
xilinx: zynqmp: Remove one static variable
There is no reason to have name variable saved in BSS section when it doesn't need to be really used. That's why remove static from variable definition and use strdup() to duplicate string with exact size from malloc area instead. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
This commit is contained in:
parent
e17c5ec8e1
commit
ced4d46626
@ -190,7 +190,7 @@ static char *zynqmp_get_silicon_idcode_name(void)
|
|||||||
{
|
{
|
||||||
u32 i;
|
u32 i;
|
||||||
u32 idcode, idcode2;
|
u32 idcode, idcode2;
|
||||||
static char name[ZYNQMP_VERSION_SIZE];
|
char name[ZYNQMP_VERSION_SIZE];
|
||||||
u32 ret_payload[PAYLOAD_ARG_CNT];
|
u32 ret_payload[PAYLOAD_ARG_CNT];
|
||||||
|
|
||||||
xilinx_pm_request(PM_GET_CHIPID, 0, 0, 0, 0, ret_payload);
|
xilinx_pm_request(PM_GET_CHIPID, 0, 0, 0, 0, ret_payload);
|
||||||
@ -218,7 +218,7 @@ static char *zynqmp_get_silicon_idcode_name(void)
|
|||||||
return "unknown";
|
return "unknown";
|
||||||
|
|
||||||
/* Add device prefix to the name */
|
/* Add device prefix to the name */
|
||||||
strncat(name, "zu", 2);
|
strncpy(name, "zu", ZYNQMP_VERSION_SIZE);
|
||||||
strncat(&name[2], simple_itoa(zynqmp_devices[i].device), 2);
|
strncat(&name[2], simple_itoa(zynqmp_devices[i].device), 2);
|
||||||
|
|
||||||
if (zynqmp_devices[i].variants & ZYNQMP_VARIANT_EV) {
|
if (zynqmp_devices[i].variants & ZYNQMP_VARIANT_EV) {
|
||||||
@ -268,7 +268,7 @@ static char *zynqmp_get_silicon_idcode_name(void)
|
|||||||
debug("Variant not identified\n");
|
debug("Variant not identified\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return name;
|
return strdup(name);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user