Commit 133ef074 authored by Sergio Lopez's avatar Sergio Lopez Committed by Paolo Bonzini
Browse files

hw/i386/pc: replace use of strtol with qemu_strtoui in x86_load_linux()



Follow checkpatch.pl recommendation and replace the use of strtol with
qemu_strtoui in x86_load_linux().

Signed-off-by: default avatarSergio Lopez <slp@redhat.com>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
parent 62a18854
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@
#include "qemu/config-file.h"
#include "qemu/error-report.h"
#include "qemu/option.h"
#include "qemu/cutils.h"
#include "hw/acpi/acpi.h"
#include "hw/acpi/cpu_hotplug.h"
#include "hw/boards.h"
@@ -1202,6 +1203,7 @@ static void x86_load_linux(PCMachineState *pcms,
    vmode = strstr(kernel_cmdline, "vga=");
    if (vmode) {
        unsigned int video_mode;
        int ret;
        /* skip "vga=" */
        vmode += 4;
        if (!strncmp(vmode, "normal", 6)) {
@@ -1211,7 +1213,12 @@ static void x86_load_linux(PCMachineState *pcms,
        } else if (!strncmp(vmode, "ask", 3)) {
            video_mode = 0xfffd;
        } else {
            video_mode = strtol(vmode, NULL, 0);
            ret = qemu_strtoui(vmode, NULL, 0, &video_mode);
            if (ret != 0) {
                fprintf(stderr, "qemu: can't parse 'vga' parameter: %s\n",
                        strerror(-ret));
                exit(1);
            }
        }
        stw_p(header + 0x1fa, video_mode);
    }