Commit f2ad5140 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Peter Maydell
Browse files

hw/arm/exynos: Convert fprintf to qemu_log_mask/error_report



qemu_log_mask() and error_report() are preferred over fprintf() for
logging errors.  Also remove square brackets [] and additional new line
characters in printed messages.

Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20170313184750.429-2-krzk@kernel.org
[PMM: wrapped long line]
Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parent 68115ed5
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
 */

#include "qemu/osdep.h"
#include "qemu/error-report.h"
#include "qemu-common.h"
#include "cpu.h"
#include "sysemu/sysemu.h"
@@ -101,8 +102,8 @@ static Exynos4210State *exynos4_boards_init_common(MachineState *machine,
    MachineClass *mc = MACHINE_GET_CLASS(machine);

    if (smp_cpus != EXYNOS4210_NCPUS && !qtest_enabled()) {
        fprintf(stderr, "%s board supports only %d CPU cores. Ignoring smp_cpus"
                " value.\n",
        error_report("%s board supports only %d CPU cores, ignoring smp_cpus"
                     " value",
                     mc->name, EXYNOS4210_NCPUS);
    }

+4 −2
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@
 */

#include "qemu/osdep.h"
#include "qemu/log.h"
#include "hw/sysbus.h"
#include "qemu/timer.h"
#include "qemu/main-loop.h"
@@ -1372,8 +1373,9 @@ break;
    case L0_TCNTO: case L1_TCNTO:
    case L0_ICNTO: case L1_ICNTO:
    case L0_FRCNTO: case L1_FRCNTO:
        fprintf(stderr, "\n[exynos4210.mct: write to RO register "
                TARGET_FMT_plx "]\n\n", offset);
        qemu_log_mask(LOG_GUEST_ERROR,
                      "exynos4210.mct: write to RO register " TARGET_FMT_plx,
                      offset);
        break;

    case L0_INT_CSTAT: case L1_INT_CSTAT:
+7 −6
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
 */

#include "qemu/osdep.h"
#include "qemu/log.h"
#include "hw/sysbus.h"
#include "qemu/timer.h"
#include "qemu-common.h"
@@ -252,8 +253,8 @@ static uint64_t exynos4210_pwm_read(void *opaque, hwaddr offset,
        break;

    default:
        fprintf(stderr,
                "[exynos4210.pwm: bad read offset " TARGET_FMT_plx "]\n",
        qemu_log_mask(LOG_GUEST_ERROR,
                      "exynos4210.pwm: bad read offset " TARGET_FMT_plx,
                      offset);
        break;
    }
@@ -343,8 +344,8 @@ static void exynos4210_pwm_write(void *opaque, hwaddr offset,
        break;

    default:
        fprintf(stderr,
                "[exynos4210.pwm: bad write offset " TARGET_FMT_plx "]\n",
        qemu_log_mask(LOG_GUEST_ERROR,
                      "exynos4210.pwm: bad write offset " TARGET_FMT_plx,
                      offset);
        break;

+10 −9
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
 */

#include "qemu/osdep.h"
#include "qemu/log.h"
#include "hw/sysbus.h"
#include "qemu/timer.h"
#include "qemu-common.h"
@@ -370,8 +371,8 @@ static uint64_t exynos4210_rtc_read(void *opaque, hwaddr offset,
        break;

    default:
        fprintf(stderr,
                "[exynos4210.rtc: bad read offset " TARGET_FMT_plx "]\n",
        qemu_log_mask(LOG_GUEST_ERROR,
                      "exynos4210.rtc: bad read offset " TARGET_FMT_plx,
                      offset);
        break;
    }
@@ -433,8 +434,8 @@ static void exynos4210_rtc_write(void *opaque, hwaddr offset,
        if (value > TICNT_THRESHOLD) {
            s->reg_ticcnt = value;
        } else {
            fprintf(stderr,
                    "[exynos4210.rtc: bad TICNT value %u ]\n",
            qemu_log_mask(LOG_GUEST_ERROR,
                          "exynos4210.rtc: bad TICNT value %u",
                          (uint32_t)value);
        }
        break;
@@ -500,8 +501,8 @@ static void exynos4210_rtc_write(void *opaque, hwaddr offset,
        break;

    default:
        fprintf(stderr,
                "[exynos4210.rtc: bad write offset " TARGET_FMT_plx "]\n",
        qemu_log_mask(LOG_GUEST_ERROR,
                      "exynos4210.rtc: bad write offset " TARGET_FMT_plx,
                      offset);
        break;