From 31448578d1259031c7c9cf9d5d455964fc8665eb Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Fri, 9 Jan 2009 04:32:51 +0000 Subject: [PATCH] phase2: use a typedefed type for the kernel function This makes things a little easier to read, particularly when we return this pointer from a function, which we'll do in the next patch. Signed-off-by: Werner Almesberger --- qiboot/src/phase2.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/qiboot/src/phase2.c b/qiboot/src/phase2.c index 9e3626e..20d2ce9 100644 --- a/qiboot/src/phase2.c +++ b/qiboot/src/phase2.c @@ -30,6 +30,9 @@ #include #include + +typedef void (*the_kernel_fn)(int zero, int arch, uint params); + unsigned long partition_offset_blocks = 0; unsigned long partition_length_blocks = 0; @@ -276,7 +279,7 @@ static int do_crc(const image_header_t *hdr, const void *kernel_dram) static void try_this_kernel(void) { - void (*the_kernel)(int zero, int arch, uint params); + the_kernel_fn the_kernel; unsigned int initramfs_len = 0; static char commandline_rootfs_append[512] = ""; int ret; @@ -368,8 +371,7 @@ static void try_this_kernel(void) if (!do_crc(hdr, kernel_dram)) return; - the_kernel = (void (*)(int, int, uint)) - (((char *)hdr) + sizeof(image_header_t)); + the_kernel = (the_kernel_fn) (((char *)hdr) + sizeof(image_header_t)); do_params(initramfs_len, commandline_rootfs_append);