Skip to content

Commit

Permalink
hw/i386/pc: avoid an assignment in if condition in x86_load_linux()
Browse files Browse the repository at this point in the history
Follow checkpatch.pl recommendation and avoid an assignment in if
condition in x86_load_linux().

Signed-off-by: Sergio Lopez <slp@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
  • Loading branch information
slp authored and bonzini committed Oct 22, 2019
1 parent 133ef07 commit 350f523
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion hw/i386/pc.c
Expand Up @@ -1045,7 +1045,14 @@ static void x86_load_linux(PCMachineState *pcms,

/* load the kernel header */
f = fopen(kernel_filename, "rb");
if (!f || !(kernel_size = get_file_size(f)) ||
if (!f) {
fprintf(stderr, "qemu: could not open kernel file '%s': %s\n",
kernel_filename, strerror(errno));
exit(1);
}

kernel_size = get_file_size(f);
if (!kernel_size ||
fread(header, 1, MIN(ARRAY_SIZE(header), kernel_size), f) !=
MIN(ARRAY_SIZE(header), kernel_size)) {
fprintf(stderr, "qemu: could not load kernel '%s': %s\n",
Expand Down

0 comments on commit 350f523

Please sign in to comment.