[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 09/47] hw/core: Replace fprintf(stderr, "*\n"
From: |
Thomas Huth |
Subject: |
Re: [Qemu-devel] [PATCH v2 09/47] hw/core: Replace fprintf(stderr, "*\n" with error_report() |
Date: |
Sun, 1 Oct 2017 16:11:41 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 30.09.2017 02:15, Alistair Francis wrote:
> 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 <address@hidden>
> Cc: "Michael S. Tsirkin" <address@hidden>
> Cc: Paolo Bonzini <address@hidden>
> ---
> V2:
> - Split hw patch into individual directories
>
> hw/core/loader.c | 31 ++++++++++++++++---------------
> hw/core/ptimer.c | 7 ++++---
> 2 files changed, 20 insertions(+), 18 deletions(-)
>
> diff --git a/hw/core/loader.c b/hw/core/loader.c
> index 4593061445..95bdcbbe36 100644
> --- a/hw/core/loader.c
> +++ b/hw/core/loader.c
> @@ -43,6 +43,7 @@
> */
>
> #include "qemu/osdep.h"
> +#include "qemu/error-report.h"
> #include "qapi/error.h"
> #include "hw/hw.h"
> #include "disas/disas.h"
> @@ -82,7 +83,7 @@ int load_image(const char *filename, uint8_t *addr)
> return -1;
> size = lseek(fd, 0, SEEK_END);
> if (size == -1) {
> - fprintf(stderr, "file %-20s: get size error: %s\n",
> + error_report("file %-20s: get size error: %s",
> filename, strerror(errno));
> close(fd);
> return -1;
> @@ -623,7 +624,7 @@ static int load_uboot_image(const char *filename, hwaddr
> *ep, hwaddr *loadaddr,
> goto out;
>
> if (hdr->ih_type != image_type) {
> - fprintf(stderr, "Wrong image type %d, expected %d\n", hdr->ih_type,
> + error_report("Wrong image type %d, expected %d", hdr->ih_type,
> image_type);
Looks like indentation is broken again in this patch. Please fix it first!
Thomas
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH v2 09/47] hw/core: Replace fprintf(stderr, "*\n" with error_report(),
Thomas Huth <=