softmmu: Provide a clue as to why device tree loading failed
PATCH 1/1 softmmu: Provide a clue as to why device tree loading failed
fdt_open_into() obligingly returns an error code in case the operation failed. So be obliging as well and use it in the error message.
--- softmmu/device_tree.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
softmmu/device_tree.c +4 -2
@@ -60,7 +60,8 @@ void *create_device_tree(int *sizep) } ret =fdt_open_into (fdt, fdt, *sizep);if (ret) { -error_report ("Unable to copy device tree in memory" ); +error_report ("%s: Unable to copy device tree into memory: %s" , + __func__,fdt_strerror (ret));exit (1 ); }
@@ -104,7 +105,8 @@ void *load_device_tree(const char *filename_path, int *sizep) ret =fdt_open_into (fdt, fdt, dt_size);if (ret) { -error_report ("Unable to copy device tree in memory" ); +error_report ("%s: Unable to copy device tree into memory: %s" , + __func__,fdt_strerror (ret)); goto fail; }
Signature · 1 line
2.34.1
Quoted 7 lines · Bernhard Beschow
fdt_open_into()obligingly returns an error code in case the operation failed. So be obliging as well and use it in the error message.Signed-off-by Bernhard Beschow <[email protected]>--- softmmu/device_tree.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
Quoted 4 lines · Bernhard Beschow
fdt_open_into()obligingly returns an error code in case the operation failed. So be obliging as well and use it in the error message.Signed-off-by Bernhard Beschow <[email protected]>
Quoted 28 lines
--- softmmu/device_tree.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)softmmu/device_tree.c +4
-2@@ -60,7 +60,8 @@ void *create_device_tree(int *sizep) } ret =fdt_open_into (fdt, fdt, *sizep);if (ret) { -error_report ("Unable to copy device tree in memory" ); +error_report ("%s: Unable to copy device tree into memory: %s" , + __func__,fdt_strerror (ret));exit (1 ); }@@ -104,7 +105,8 @@ void *load_device_tree(const char *filename_path, int *sizep) ret =fdt_open_into (fdt, fdt, dt_size);if (ret) { -error_report ("Unable to copy device tree in memory" ); +error_report ("%s: Unable to copy device tree into memory: %s" , + __func__,fdt_strerror (ret)); goto fail; }
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Quoted 5 lines · Bernhard Beschow
fdt_open_into()obligingly returns an error code in case the operation failed. So be obliging as well and use it in the error message.Signed-off-by Bernhard Beschow <[email protected]>
Alistair
Quoted 32 lines
--- softmmu/device_tree.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)softmmu/device_tree.c +4
-3@@ -60,7 +60,8 @@ void *create_device_tree(int *sizep) } ret =fdt_open_into (fdt, fdt, *sizep);if (ret) { -error_report ("Unable to copy device tree in memory" ); +error_report ("%s: Unable to copy device tree into memory: %s" , + __func__,fdt_strerror (ret));exit (1 ); }@@ -104,7 +105,8 @@ void *load_device_tree(const char *filename_path, int *sizep) ret =fdt_open_into (fdt, fdt, dt_size);if (ret) { -error_report ("Unable to copy device tree in memory" ); +error_report ("%s: Unable to copy device tree into memory: %s" , + __func__,fdt_strerror (ret)); goto fail; } --2.34.1
Laurent Vivier
AppliedLe 16/01/2022 à 12:46, Bernhard Beschow a écrit :
Quoted 23 lines
fdt_open_into()obligingly returns an error code in case the operation failed. So be obliging as well and use it in the error message.Signed-off-by Bernhard Beschow <[email protected]>--- softmmu/device_tree.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)softmmu/device_tree.c +2
-1@@ -60,7 +60,8 @@ void *create_device_tree(int *sizep) } ret =fdt_open_into (fdt, fdt, *sizep);if (ret) { -error_report ("Unable to copy device tree in memory" ); +error_report ("%s: Unable to copy device tree into memory: %s" , + __func__,fdt_strerror (ret));exit (1 ); }
softmmu/device_tree.c void *load_device_tree(const char *filename_path, int *sizep) · line 112
Quoted 9 lines
softmmu/device_tree.c +2
-1@@ -104,7 +105,8 @@ void *load_device_tree(const char *filename_path, int *sizep) ret =fdt_open_into (fdt, fdt, dt_size);if (ret) { -error_report ("Unable to copy device tree in memory" ); +error_report ("%s: Unable to copy device tree into memory: %s" , + __func__,fdt_strerror (ret)); goto fail; }
Applied to my trivial-patches branch.
Thanks,
Laurent