From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
qemu-arm@nongnu.org, "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Alistair Francis" <alistair@alistair23.me>,
"Alistair Francis" <alistair.francis@xilinx.com>
Subject: [PATCH v4 01/10] hw/sd/pl181: Replace fprintf(stderr, "*\n") with error_report()
Date: Sun, 5 Jul 2020 22:46:21 +0200 [thread overview]
Message-ID: <20200705204630.4133-2-f4bug@amsat.org> (raw)
In-Reply-To: <20200705204630.4133-1-f4bug@amsat.org>
From: Alistair Francis <alistair.francis@xilinx.com>
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.
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
Message-Id: <488ba8d4c562ea44119de8ea0f385a898bd8fa1e.1513790495.git.alistair.francis@xilinx.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/sd/pl181.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/hw/sd/pl181.c b/hw/sd/pl181.c
index 2b3776a6a0..649386ec3d 100644
--- a/hw/sd/pl181.c
+++ b/hw/sd/pl181.c
@@ -15,6 +15,7 @@
#include "hw/sd/sd.h"
#include "qemu/log.h"
#include "qemu/module.h"
+#include "qemu/error-report.h"
#include "qapi/error.h"
//#define DEBUG_PL181 1
@@ -148,7 +149,7 @@ static void pl181_fifo_push(PL181State *s, uint32_t value)
int n;
if (s->fifo_len == PL181_FIFO_LEN) {
- fprintf(stderr, "pl181: FIFO overflow\n");
+ error_report("%s: FIFO overflow", __func__);
return;
}
n = (s->fifo_pos + s->fifo_len) & (PL181_FIFO_LEN - 1);
@@ -162,7 +163,7 @@ static uint32_t pl181_fifo_pop(PL181State *s)
uint32_t value;
if (s->fifo_len == 0) {
- fprintf(stderr, "pl181: FIFO underflow\n");
+ error_report("%s: FIFO underflow", __func__);
return 0;
}
value = s->fifo[s->fifo_pos];
--
2.21.3
next prev parent reply other threads:[~2020-07-05 20:49 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-05 20:46 [PATCH v4 00/10] hw/sd: convert legacy SDHCI devices to the SDBus API Philippe Mathieu-Daudé
2020-07-05 20:46 ` Philippe Mathieu-Daudé [this message]
2020-07-05 20:46 ` [PATCH v4 02/10] hw/sd/pl181: Rename pl181_send_command() as pl181_do_command() Philippe Mathieu-Daudé
2020-07-06 15:46 ` Alistair Francis
2020-07-05 20:46 ` [PATCH v4 03/10] hw/sd/pl181: Add TODO to use Fifo32 API Philippe Mathieu-Daudé
2020-07-05 20:46 ` [PATCH v4 04/10] hw/arm/versatilepb: Comment to remember some IRQs lines are left unwired Philippe Mathieu-Daudé
2020-07-07 18:31 ` Peter Maydell
2020-07-05 20:46 ` [PATCH v4 05/10] hw/sd/pl181: Use named GPIOs Philippe Mathieu-Daudé
2020-07-06 15:48 ` Alistair Francis
2020-07-05 20:46 ` [PATCH v4 06/10] hw/sd/pl181: Expose a SDBus and connect the SDCard to it Philippe Mathieu-Daudé
2020-07-06 16:12 ` Alistair Francis
2020-07-05 20:46 ` [PATCH v4 07/10] hw/sd/pl181: Do not create SD card within the SDHCI controller Philippe Mathieu-Daudé
2020-07-06 16:06 ` Alistair Francis
2020-07-09 18:20 ` Peter Maydell
2020-07-05 20:46 ` [PATCH v4 08/10] hw/sd/pl181: Replace disabled fprintf()s by trace events Philippe Mathieu-Daudé
2020-07-06 16:13 ` Alistair Francis
2020-07-05 20:46 ` [PATCH v4 09/10] hw/sd/sdcard: make sd_data_ready() static Philippe Mathieu-Daudé
2020-07-05 20:46 ` [PATCH v4 10/10] hw/sd: move sdcard legacy API to 'hw/sd/sdcard_legacy.h' Philippe Mathieu-Daudé
2020-07-09 18:24 ` [PATCH v4 00/10] hw/sd: convert legacy SDHCI devices to the SDBus API Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200705204630.4133-2-f4bug@amsat.org \
--to=f4bug@amsat.org \
--cc=alistair.francis@xilinx.com \
--cc=alistair@alistair23.me \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).