aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/lib
diff options
context:
space:
mode:
authorSimon Glass2020-11-04 09:57:18 -0700
committerBin Meng2020-11-05 14:58:45 +0800
commit38e498c3a2b5b52e7935516cba0927e0d90c365c (patch)
treefe31ec366ac573b57b44f0f15d2031c565a50622 /arch/x86/lib
parent653554b40aa5c1d32e9a6281dc97f1b75eff724b (diff)
x86: Allow writing tables to fail
At present write_tables() can fail but does not report this problem to its caller. Fix this by changing the return type. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch/x86/lib')
-rw-r--r--arch/x86/lib/tables.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/lib/tables.c b/arch/x86/lib/tables.c
index 7bad5dd3032..7099866a78a 100644
--- a/arch/x86/lib/tables.c
+++ b/arch/x86/lib/tables.c
@@ -64,7 +64,7 @@ void table_fill_string(char *dest, const char *src, size_t n, char pad)
dest[i] = pad;
}
-void write_tables(void)
+int write_tables(void)
{
u32 rom_table_start = ROM_TABLE_ADDR;
u32 rom_table_end;
@@ -91,6 +91,7 @@ void write_tables(void)
cfg_tables[i].size = table_size;
} else {
printf("%d: no memory for configuration tables\n", i);
+ return -ENOSPC;
}
#endif
@@ -105,4 +106,6 @@ void write_tables(void)
write_coreboot_table(CB_TABLE_ADDR, cfg_tables);
#endif
debug("- done writing tables\n");
+
+ return 0;
}