Skip to content

Commit

Permalink
pc-bios/s390-ccw: Move ipl-related code from main() into a separate f…
Browse files Browse the repository at this point in the history
…unction

Let's move this part of the code into a separate function to be able
to use it from multiple spots later.

Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Message-Id: <20200806105349.632-3-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
  • Loading branch information
huth committed Oct 6, 2020
1 parent 4f6a1eb commit d1f060a
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions pc-bios/s390-ccw/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,8 @@ static void virtio_setup(void)
}
}

int main(void)
static void ipl_boot_device(void)
{
sclp_setup();
css_setup();
boot_setup();
find_boot_device();
enable_subchannel(blk_schid);

switch (cutype) {
case CU_TYPE_DASD_3990:
case CU_TYPE_DASD_2107:
Expand All @@ -242,8 +236,18 @@ int main(void)
break;
default:
print_int("Attempting to boot from unexpected device type", cutype);
panic("");
panic("\nBoot failed.\n");
}
}

int main(void)
{
sclp_setup();
css_setup();
boot_setup();
find_boot_device();
enable_subchannel(blk_schid);
ipl_boot_device();

panic("Failed to load OS from hard disk\n");
return 0; /* make compiler happy */
Expand Down

0 comments on commit d1f060a

Please sign in to comment.