mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
hw/sparc*: Replace fprintf(stderr, "*\n" with error_report()
Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> Cc: Fabien Chouteau <chouteau@adacore.com> Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Cc: Artyom Tarasenko <atar4qemu@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20180203084315.20497-12-armbru@redhat.com>
This commit is contained in:
parent
4e82512586
commit
29bd723171
4 changed files with 21 additions and 25 deletions
|
@ -22,6 +22,7 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu-common.h"
|
||||
#include "cpu.h"
|
||||
|
@ -139,9 +140,8 @@ static void leon3_generic_hw_init(MachineState *machine)
|
|||
|
||||
/* Allocate RAM */
|
||||
if ((uint64_t)ram_size > (1UL << 30)) {
|
||||
fprintf(stderr,
|
||||
"qemu: Too much memory for this machine: %d, maximum 1G\n",
|
||||
(unsigned int)(ram_size / (1024 * 1024)));
|
||||
error_report("Too much memory for this machine: %d, maximum 1G",
|
||||
(unsigned int)(ram_size / (1024 * 1024)));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
@ -167,19 +167,18 @@ static void leon3_generic_hw_init(MachineState *machine)
|
|||
}
|
||||
|
||||
if (bios_size > prom_size) {
|
||||
fprintf(stderr, "qemu: could not load prom '%s': file too big\n",
|
||||
filename);
|
||||
error_report("could not load prom '%s': file too big", filename);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (bios_size > 0) {
|
||||
ret = load_image_targphys(filename, 0x00000000, bios_size);
|
||||
if (ret < 0 || ret > prom_size) {
|
||||
fprintf(stderr, "qemu: could not load prom '%s'\n", filename);
|
||||
error_report("could not load prom '%s'", filename);
|
||||
exit(1);
|
||||
}
|
||||
} else if (kernel_filename == NULL && !qtest_enabled()) {
|
||||
fprintf(stderr, "Can't read bios image %s\n", filename);
|
||||
error_report("Can't read bios image %s", filename);
|
||||
exit(1);
|
||||
}
|
||||
g_free(filename);
|
||||
|
@ -192,8 +191,7 @@ static void leon3_generic_hw_init(MachineState *machine)
|
|||
kernel_size = load_elf(kernel_filename, NULL, NULL, &entry, NULL, NULL,
|
||||
1 /* big endian */, EM_SPARC, 0, 0);
|
||||
if (kernel_size < 0) {
|
||||
fprintf(stderr, "qemu: could not load kernel '%s'\n",
|
||||
kernel_filename);
|
||||
error_report("could not load kernel '%s'", kernel_filename);
|
||||
exit(1);
|
||||
}
|
||||
if (bios_size <= 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue