[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 24/46] hw/misc: Replace fprintf(stderr, "*\n" wit
From: |
Alistair Francis |
Subject: |
[Qemu-devel] [PATCH v3 24/46] hw/misc: Replace fprintf(stderr, "*\n" with error_report() |
Date: |
Thu, 19 Oct 2017 09:17:02 -0700 |
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>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
---
V2:
- Split hw patch into individual directories
hw/misc/a9scu.c | 3 ++-
hw/misc/omap_gpmc.c | 11 ++++++-----
hw/misc/omap_l4.c | 5 +++--
hw/misc/omap_sdrc.c | 3 ++-
hw/misc/vmport.c | 2 +-
5 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/hw/misc/a9scu.c b/hw/misc/a9scu.c
index 3e8ad8cd73..21b8e49b6c 100644
--- a/hw/misc/a9scu.c
+++ b/hw/misc/a9scu.c
@@ -9,6 +9,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/error-report.h"
#include "hw/misc/a9scu.h"
static uint64_t a9_scu_read(void *opaque, hwaddr offset,
@@ -59,7 +60,7 @@ static void a9_scu_write(void *opaque, hwaddr offset,
mask = 0xffffffff;
break;
default:
- fprintf(stderr, "Invalid size %u in write to a9 scu register %x\n",
+ error_report("Invalid size %u in write to a9 scu register %x",
size, (unsigned)offset);
return;
}
diff --git a/hw/misc/omap_gpmc.c b/hw/misc/omap_gpmc.c
index 84f9e4c612..e3b30e90ea 100644
--- a/hw/misc/omap_gpmc.c
+++ b/hw/misc/omap_gpmc.c
@@ -19,6 +19,7 @@
* with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu/osdep.h"
+#include "qemu/error-report.h"
#include "hw/hw.h"
#include "hw/block/flash.h"
#include "hw/arm/omap.h"
@@ -408,7 +409,7 @@ static void omap_gpmc_cs_map(struct omap_gpmc_s *s, int cs)
/* TODO: check for overlapping regions and report access errors */
if (mask != 0x8 && mask != 0xc && mask != 0xe && mask != 0xf
&& !(s->accept_256 && !mask)) {
- fprintf(stderr, "%s: invalid chip-select mask address (0x%x)\n",
+ error_report("%s: invalid chip-select mask address (0x%x)",
__func__, mask);
}
@@ -642,7 +643,7 @@ static void omap_gpmc_write(void *opaque, hwaddr addr,
case 0x010: /* GPMC_SYSCONFIG */
if ((value >> 3) == 0x3)
- fprintf(stderr, "%s: bad SDRAM idle mode %"PRIi64"\n",
+ error_report("%s: bad SDRAM idle mode %"PRIi64"",
__func__, value >> 3);
if (value & 2)
omap_gpmc_reset(s);
@@ -806,7 +807,7 @@ static void omap_gpmc_write(void *opaque, hwaddr addr,
break;
case 0x230: /* GPMC_TESTMODE_CTRL */
if (value & 7)
- fprintf(stderr, "%s: test mode enable attempt\n", __func__);
+ error_report("%s: test mode enable attempt", __func__);
break;
default:
@@ -864,7 +865,7 @@ void omap_gpmc_attach(struct omap_gpmc_s *s, int cs,
MemoryRegion *iomem)
assert(iomem);
if (cs < 0 || cs >= 8) {
- fprintf(stderr, "%s: bad chip-select %i\n", __func__, cs);
+ error_report("%s: bad chip-select %i", __func__, cs);
exit(-1);
}
f = &s->cs_file[cs];
@@ -881,7 +882,7 @@ void omap_gpmc_attach_nand(struct omap_gpmc_s *s, int cs,
DeviceState *nand)
assert(nand);
if (cs < 0 || cs >= 8) {
- fprintf(stderr, "%s: bad chip-select %i\n", __func__, cs);
+ error_report("%s: bad chip-select %i", __func__, cs);
exit(-1);
}
f = &s->cs_file[cs];
diff --git a/hw/misc/omap_l4.c b/hw/misc/omap_l4.c
index 96fc057b4e..47d9c10aeb 100644
--- a/hw/misc/omap_l4.c
+++ b/hw/misc/omap_l4.c
@@ -18,6 +18,7 @@
* with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu/osdep.h"
+#include "qemu/error-report.h"
#include "hw/hw.h"
#include "hw/arm/omap.h"
@@ -126,7 +127,7 @@ struct omap_target_agent_s *omap_l4ta_get(struct omap_l4_s
*bus,
break;
}
if (!ta) {
- fprintf(stderr, "%s: bad target agent (%i)\n", __func__, cs);
+ error_report("%s: bad target agent (%i)", __func__, cs);
exit(-1);
}
@@ -151,7 +152,7 @@ hwaddr omap_l4_attach(struct omap_target_agent_s *ta,
hwaddr base;
if (region < 0 || region >= ta->regions) {
- fprintf(stderr, "%s: bad io region (%i)\n", __func__, region);
+ error_report("%s: bad io region (%i)", __func__, region);
exit(-1);
}
diff --git a/hw/misc/omap_sdrc.c b/hw/misc/omap_sdrc.c
index 7b38c5568c..3dcabc1e00 100644
--- a/hw/misc/omap_sdrc.c
+++ b/hw/misc/omap_sdrc.c
@@ -18,6 +18,7 @@
* with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu/osdep.h"
+#include "qemu/error-report.h"
#include "hw/hw.h"
#include "hw/arm/omap.h"
@@ -108,7 +109,7 @@ static void omap_sdrc_write(void *opaque, hwaddr addr,
case 0x10: /* SDRC_SYSCONFIG */
if ((value >> 3) != 0x2)
- fprintf(stderr, "%s: bad SDRAM idle mode %i\n",
+ error_report("%s: bad SDRAM idle mode %i",
__func__, (unsigned)value >> 3);
if (value & 2)
omap_sdrc_reset(s);
diff --git a/hw/misc/vmport.c b/hw/misc/vmport.c
index 165500223f..55369bd180 100644
--- a/hw/misc/vmport.c
+++ b/hw/misc/vmport.c
@@ -80,7 +80,7 @@ static uint64_t vmport_ioport_read(void *opaque, hwaddr addr,
if (!s->func[command])
{
#ifdef VMPORT_DEBUG
- fprintf(stderr, "vmport: unknown command %x\n", command);
+ error_report("vmport: unknown command %x", command);
#endif
return eax;
}
--
2.11.0
- [Qemu-devel] [PATCH v3 11/46] hw/display: Replace fprintf(stderr, "*\n" with error_report(), (continued)
- [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
- [Qemu-devel] [PATCH v3 01/46] Replace all occurances of __FUNCTION__ with __func__, Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 22/46] hw/microblaze: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 20/46] hw/isa: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 21/46] hw/lm32: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 24/46] hw/misc: Replace fprintf(stderr, "*\n" with error_report(),
Alistair Francis <=
- [Qemu-devel] [PATCH v3 23/46] hw/mips: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 25/46] hw/moxie: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 26/46] hw/net: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 28/46] hw/nvram: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 27/46] hw/nios2: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 32/46] hw/s390x: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 30/46] hw/pci*: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 29/46] hw/openrisc: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19
- [Qemu-devel] [PATCH v3 31/46] hw/ppc: Replace fprintf(stderr, "*\n" with error_report(), Alistair Francis, 2017/10/19