All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	qemu-block@nongnu.org, "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Andrew Baumann" <Andrew.Baumann@microsoft.com>,
	"Alistair Francis" <alistair.francis@xilinx.com>,
	"Beniamino Galvani" <b.galvani@gmail.com>,
	"Michael Walle" <michael@walle.cc>,
	qemu-arm@nongnu.org
Subject: [PULL 06/23] hw/sd/pl181: Replace fprintf(stderr, "*\n") with error_report()
Date: Fri, 21 Aug 2020 19:28:59 +0200	[thread overview]
Message-ID: <20200821172916.1260954-7-f4bug@amsat.org> (raw)
In-Reply-To: <20200821172916.1260954-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>
Acked-by: Peter Maydell <peter.maydell@linaro.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 2b3776a6a0f..649386ec3d1 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.26.2



  parent reply	other threads:[~2020-08-21 17:34 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-21 17:28 [PULL 00/23] SD/MMC patches for 2020-08-21 Philippe Mathieu-Daudé
2020-08-21 17:28 ` [PULL 01/23] hw/sd/pxa2xx_mmci: Do not create SD card within the SD host controller Philippe Mathieu-Daudé
2020-08-21 17:28 ` [PULL 02/23] hw/sd/pxa2xx_mmci: Trivial simplification Philippe Mathieu-Daudé
2020-08-21 17:28 ` [PULL 03/23] hw/lm32/milkymist: Un-inline milkymist_memcard_create() Philippe Mathieu-Daudé
2020-08-21 17:28 ` [PULL 04/23] hw/sd/milkymist: Create the SDBus at init() Philippe Mathieu-Daudé
2020-08-21 17:28 ` [PULL 05/23] hw/sd/milkymist: Do not create SD card within the SD host controller Philippe Mathieu-Daudé
2020-08-21 17:28 ` Philippe Mathieu-Daudé [this message]
2020-08-21 17:29 ` [PULL 07/23] hw/sd/pl181: Rename pl181_send_command() as pl181_do_command() Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 08/23] hw/sd/pl181: Add TODO to use Fifo32 API Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 09/23] hw/sd/pl181: Use named GPIOs Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 10/23] hw/sd/pl181: Expose a SDBus and connect the SDCard to it Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 11/23] hw/sd/pl181: Do not create SD card within the SD host controller Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 12/23] hw/sd/pl181: Replace disabled fprintf()s by trace events Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 13/23] hw/sd/sdcard: Make sd_data_ready() static Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 14/23] hw/sd: Move sdcard legacy API to 'hw/sd/sdcard_legacy.h' Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 15/23] hw/sd: Rename read/write_data() as read/write_byte() Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 16/23] hw/sd: Rename sdbus_write_data() as sdbus_write_byte() Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 17/23] hw/sd: Rename sdbus_read_data() as sdbus_read_byte() Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 18/23] hw/sd: Add sdbus_write_data() to write multiples bytes on the data line Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 19/23] hw/sd: Use sdbus_write_data() instead of sdbus_write_byte when possible Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 20/23] hw/sd: Add sdbus_read_data() to read multiples bytes on the data line Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 21/23] hw/sd: Use sdbus_read_data() instead of sdbus_read_byte() when possible Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 22/23] hw/sd: Fix incorrect populated function switch status data structure Philippe Mathieu-Daudé
2020-10-20 15:16   ` Philippe Mathieu-Daudé
2020-10-21  9:57     ` Bin Meng
2020-10-21 10:07       ` Philippe Mathieu-Daudé
2020-10-22 14:47         ` Bin Meng
2020-10-22 15:20           ` Niek Linnenbank
2020-10-23  2:02             ` Bin Meng
2020-10-23  9:23               ` Philippe Mathieu-Daudé
2020-10-23  9:34                 ` Should we keep using Avocado for functional testing? (was: Re: [PULL 22/23] hw/sd: Fix incorrect populated function switch status data structure) Philippe Mathieu-Daudé
2020-10-24 21:41                   ` Niek Linnenbank
2020-10-26 16:14                   ` Cleber Rosa
2020-08-21 17:29 ` [PULL 23/23] hw/sd: Correct the maximum size of a Standard Capacity SD Memory Card Philippe Mathieu-Daudé
2020-08-23 10:37 ` [PULL 00/23] SD/MMC patches for 2020-08-21 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=20200821172916.1260954-7-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=Andrew.Baumann@microsoft.com \
    --cc=alistair.francis@xilinx.com \
    --cc=b.galvani@gmail.com \
    --cc=michael@walle.cc \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-block@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.