[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 10/46] hw/cris: Replace fprintf(stderr, "*\n"
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [PATCH v3 10/46] hw/cris: Replace fprintf(stderr, "*\n" with error_report() |
Date: |
Fri, 20 Oct 2017 00:19:21 -0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 10/19/2017 01:16 PM, 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>
> "Edgar E. Iglesias" <address@hidden>
Is this a Reviewed-by tag?
Anyway:
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> V2:
> - Split hw patch into individual directories
>
> hw/cris/axis_dev88.c | 3 ++-
> hw/cris/boot.c | 6 +++---
> 2 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/hw/cris/axis_dev88.c b/hw/cris/axis_dev88.c
> index 5eb552bce2..d121836b69 100644
> --- a/hw/cris/axis_dev88.c
> +++ b/hw/cris/axis_dev88.c
> @@ -23,6 +23,7 @@
> */
>
> #include "qemu/osdep.h"
> +#include "qemu/error-report.h"
> #include "qapi/error.h"
> #include "qemu-common.h"
> #include "cpu.h"
> @@ -349,7 +350,7 @@ void axisdev88_init(MachineState *machine)
> li.cmdline = kernel_cmdline;
> cris_load_image(cpu, &li);
> } else if (!qtest_enabled()) {
> - fprintf(stderr, "Kernel image must be specified\n");
> + error_report("Kernel image must be specified");
> exit(1);
> }
> }
> diff --git a/hw/cris/boot.c b/hw/cris/boot.c
> index f896ed7f86..fda0a039b8 100644
> --- a/hw/cris/boot.c
> +++ b/hw/cris/boot.c
> @@ -23,6 +23,7 @@
> */
>
> #include "qemu/osdep.h"
> +#include "qemu/error-report.h"
> #include "qemu-common.h"
> #include "cpu.h"
> #include "hw/hw.h"
> @@ -86,14 +87,13 @@ void cris_load_image(CRISCPU *cpu, struct cris_load_info
> *li)
> }
>
> if (image_size < 0) {
> - fprintf(stderr, "qemu: could not load kernel '%s'\n",
> - li->image_filename);
> + error_report("could not load kernel '%s'", li->image_filename);
> exit(1);
> }
>
> if (li->cmdline && (kcmdline_len = strlen(li->cmdline))) {
> if (kcmdline_len > 256) {
> - fprintf(stderr, "Too long CRIS kernel cmdline (max 256)\n");
> + error_report("Too long CRIS kernel cmdline (max 256)");
> exit(1);
> }
> pstrcpy_targphys("cmdline", 0x40000000, 256, li->cmdline);
>
- [Qemu-devel] [PATCH v3 00/46] Remove some of the fprintf(stderr, "*, Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 02/46] Fixes after renaming __FUNCTION__ to __func__, Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 03/46] audio: Replace AUDIO_FUNC with __func__, Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 08/46] hw/char: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 07/46] hw/bt: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 06/46] hw/block: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 05/46] hw/arm: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 04/46] tests: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 10/46] hw/cris: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- Re: [Qemu-devel] [PATCH v3 10/46] hw/cris: Replace fprintf(stderr, "*\n" with error_report(),
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH v3 14/46] hw/i2c: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 09/46] hw/core: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 12/46] hw/dma: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 11/46] hw/display: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 13/46] hw/gpio: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 16/46] hw/ide: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 18/46] hw/intc: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 19/46] hw/ipmi: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 17/46] hw/input: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19