Skip to content

Commit

Permalink
initrd: cast initrd_start' to void *'
Browse files Browse the repository at this point in the history
commit fb6624e (initrd: Fix virtual/physical
mix-up in overwrite test) introduced the compiler warning below on mips,
as its virt_to_page() doesn't cast the passed address to unsigned long
internally, unlike on most other architectures:

init/main.c: In function `start_kernel':
init/main.c:633: warning: passing argument 1 of `virt_to_phys' makes pointer from integer without a cast
init/main.c:636: warning: passing argument 1 of `virt_to_phys' makes pointer from integer without a cast

For now, kill the warning by explicitly casting initrd_start to `void *', as
that's the type it should really be.

Reported-by: Atsushi Nemoto <[email protected]>
Signed-off-by: Geert Uytterhoeven <[email protected]>
Cc: Ralf Baechle <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
geertu authored and torvalds committed Jul 30, 2008
1 parent 06ac667 commit bd673c7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,10 +635,11 @@ asmlinkage void __init start_kernel(void)

#ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start && !initrd_below_start_ok &&
page_to_pfn(virt_to_page(initrd_start)) < min_low_pfn) {
page_to_pfn(virt_to_page((void *)initrd_start)) < min_low_pfn) {
printk(KERN_CRIT "initrd overwritten (0x%08lx < 0x%08lx) - "
"disabling it.\n",
page_to_pfn(virt_to_page(initrd_start)), min_low_pfn);
page_to_pfn(virt_to_page((void *)initrd_start)),
min_low_pfn);
initrd_start = 0;
}
#endif
Expand Down

0 comments on commit bd673c7

Please sign in to comment.