mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
UPSTREAM: amd/amdht: Fix format security errors
Ubuntus default compiler flags for GCC [1][2] include `-Wformat
-Wformat-security`, causing errors similar like the one below.
```
CC romstage/northbridge/amd/amdht/ht_wrapper.o
src/northbridge/amd/amdht/ht_wrapper.c: In function 'AMD_CB_EventNotify':
src/northbridge/amd/amdht/ht_wrapper.c:124:4: error: format not a string literal and no format arguments [-Werror=format-security]
printk(log_level, event_class_string_decodes[evtClass]);
^
[]
```
Fix that, by explicitly using a format string.
TEST=Built and booted on ASUS KGPE-D16.
[1] https://stackoverflow.com/questions/17260409/fprintf-error-format-not-a-string-literal-and-no-format-arguments-werror-for
"fprintf, error: format not a string literal and no format arguments [-Werror=format-security"
[2] I tested with gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609.
Change-Id: Iff829bf83e1ead8537fbe5d7c5c6376bdd77f323
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: f6776fa62c
Original-Change-Id: Iabe60deeffa441146eab31dac4416846ce95c32a
Original-Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
Original-Reviewed-on: https://review.coreboot.org/18208
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://chromium-review.googlesource.com/433880
This commit is contained in:
parent
44c4889d2e
commit
caba0d26c5
1 changed files with 6 additions and 6 deletions
|
@ -121,7 +121,7 @@ static void AMD_CB_EventNotify (u8 evtClass, u16 event, const u8 *pEventData0)
|
|||
case HT_EVENT_CLASS_WARNING:
|
||||
case HT_EVENT_CLASS_INFO:
|
||||
log_level = BIOS_DEBUG;
|
||||
printk(log_level, event_class_string_decodes[evtClass]);
|
||||
printk(log_level, "%s", event_class_string_decodes[evtClass]);
|
||||
break;
|
||||
default:
|
||||
log_level = BIOS_DEBUG;
|
||||
|
@ -135,7 +135,7 @@ static void AMD_CB_EventNotify (u8 evtClass, u16 event, const u8 *pEventData0)
|
|||
case HT_EVENT_COH_NO_TOPOLOGY:
|
||||
case HT_EVENT_COH_LINK_EXCEED:
|
||||
case HT_EVENT_COH_FAMILY_FEUD:
|
||||
printk(log_level, event_string_decode(event));
|
||||
printk(log_level, "%s", event_string_decode(event));
|
||||
break;
|
||||
case HT_EVENT_COH_NODE_DISCOVERED:
|
||||
{
|
||||
|
@ -152,11 +152,11 @@ static void AMD_CB_EventNotify (u8 evtClass, u16 event, const u8 *pEventData0)
|
|||
case HT_EVENT_NCOH_LINK_EXCEED:
|
||||
case HT_EVENT_NCOH_BUS_MAX_EXCEED:
|
||||
case HT_EVENT_NCOH_CFG_MAP_EXCEED:
|
||||
printk(log_level, event_string_decode(event));
|
||||
printk(log_level, "%s", event_string_decode(event));
|
||||
break;
|
||||
case HT_EVENT_NCOH_DEVICE_FAILED:
|
||||
{
|
||||
printk(log_level, event_string_decode(event));
|
||||
printk(log_level, "%s", event_string_decode(event));
|
||||
sHtEventNcohDeviceFailed *evt = (sHtEventNcohDeviceFailed*)pEventData0;
|
||||
printk(log_level, ": node %d link %d depth: %d attemptedBUID: %d",
|
||||
evt->node, evt->link, evt->depth, evt->attemptedBUID);
|
||||
|
@ -165,7 +165,7 @@ static void AMD_CB_EventNotify (u8 evtClass, u16 event, const u8 *pEventData0)
|
|||
}
|
||||
case HT_EVENT_NCOH_AUTO_DEPTH:
|
||||
{
|
||||
printk(log_level, event_string_decode(event));
|
||||
printk(log_level, "%s", event_string_decode(event));
|
||||
sHtEventNcohAutoDepth *evt = (sHtEventNcohAutoDepth*)pEventData0;
|
||||
printk(log_level, ": node %d link %d depth: %d",
|
||||
evt->node, evt->link, evt->depth);
|
||||
|
@ -178,7 +178,7 @@ static void AMD_CB_EventNotify (u8 evtClass, u16 event, const u8 *pEventData0)
|
|||
case HT_EVENT_HW_EVENTS:
|
||||
case HT_EVENT_HW_SYNCHFLOOD:
|
||||
case HT_EVENT_HW_HTCRC:
|
||||
printk(log_level, event_string_decode(event));
|
||||
printk(log_level, "%s", event_string_decode(event));
|
||||
break;
|
||||
default:
|
||||
printk(log_level, "HT_EVENT_UNKNOWN");
|
||||
|
|
Loading…
Add table
Reference in a new issue