[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v7 10/15] hw/sd: Replace fprintf(stderr, "*\n" w
From: |
Thomas Huth |
Subject: |
Re: [Qemu-devel] [PATCH v7 10/15] hw/sd: Replace fprintf(stderr, "*\n" with error_report() |
Date: |
Sat, 3 Feb 2018 21:12:43 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 |
On 02.02.2018 19:37, Markus Armbruster wrote:
> From: Alistair Francis <address@hidden>
>
> 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.
I think you could pretty much ditch the original patch description since
nothing gets converted to error_report here anymore...
> Some of the prints in hw/sd/sd.c were manually converted to using
> DPRINTF() instead.
... and just use the above sentence (in a maybe slightly adapted way).
> Signed-off-by: Alistair Francis <address@hidden>
>
> Conversions that aren't followed by exit() dropped, because they might
> be inappropriate.
>
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
> hw/sd/sd.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/hw/sd/sd.c b/hw/sd/sd.c
> index 35347a5bbc..73e405a04f 100644
> --- a/hw/sd/sd.c
> +++ b/hw/sd/sd.c
> @@ -1564,9 +1564,10 @@ send_response:
> if (rsplen) {
> int i;
> DPRINTF("Response:");
> - for (i = 0; i < rsplen; i++)
> - fprintf(stderr, " %02x", response[i]);
> - fprintf(stderr, " state %d\n", sd->state);
> + for (i = 0; i < rsplen; i++) {
> + DPRINTF(" %02x", response[i]);
> + }
> + DPRINTF(" state %d\n", sd->state);
> } else {
> DPRINTF("No response %d\n", sd->state);
> }
>
With the patch description updated:
Reviewed-by: Thomas Huth <address@hidden>
- [Qemu-devel] [PATCH v7 09/15] hw/ppc: Replace fprintf(stderr, "*\n" with error_report(), (continued)
- [Qemu-devel] [PATCH v7 09/15] hw/ppc: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/02
- [Qemu-devel] [PATCH v7 06/15] hw/moxie: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/02
- [Qemu-devel] [PATCH v7 11/15] hw/sparc*: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/02
- [Qemu-devel] [PATCH v7 14/15] tcg: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/02
- [Qemu-devel] [PATCH v7 07/15] hw/openrisc: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/02
- [Qemu-devel] [PATCH v7 12/15] hw/timer: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/02
- [Qemu-devel] [PATCH v7 05/15] hw/mips: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/02
- [Qemu-devel] [PATCH v7 10/15] hw/sd: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/02
- Re: [Qemu-devel] [PATCH v7 10/15] hw/sd: Replace fprintf(stderr, "*\n" with error_report(),
Thomas Huth <=
- [Qemu-devel] [PATCH v7 01/15] audio: Replace AUDIO_FUNC with __func__, Markus Armbruster, 2018/02/02
- [Qemu-devel] [PATCH v7 13/15] hw/xen*: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/02
- [Qemu-devel] [PATCH v7 08/15] hw/pci*: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/02
- [Qemu-devel] [PATCH v7 03/15] hw/dma: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/02
- [Qemu-devel] [PATCH v7 02/15] hw/arm: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/02
- [Qemu-devel] [PATCH v7 15/15] target: Use qemu_log() instead of fprintf(stderr, ...), Markus Armbruster, 2018/02/02