From: Andrew Morton Date: Mon, 10 Jul 2006 11:45:00 +0000 (-0700) Subject: [PATCH] swsusp warning fix X-Git-Tag: v2.6.18-rc2~171 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=712f403af6682c942d8ff8bfbd54eed03643a796;p=linux-2.6 [PATCH] swsusp warning fix kernel/power/swap.c: In function 'swsusp_write': kernel/power/swap.c:275: warning: 'start' may be used uninitialized in this function gcc isn't smart enough, so help it. Cc: Pavel Machek Cc: "Rafael J. Wysocki" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/power/swap.c b/kernel/power/swap.c index 044b8e0c10..a57c661c7e 100644 --- a/kernel/power/swap.c +++ b/kernel/power/swap.c @@ -263,7 +263,6 @@ int swsusp_write(void) struct swap_map_handle handle; struct snapshot_handle snapshot; struct swsusp_info *header; - unsigned long start; int error; if ((error = swsusp_swap_check())) { @@ -281,16 +280,17 @@ int swsusp_write(void) } error = get_swap_writer(&handle); if (!error) { - start = handle.cur_swap; + unsigned long start = handle.cur_swap; error = swap_write_page(&handle, header); - } - if (!error) - error = save_image(&handle, &snapshot, header->pages - 1); - if (!error) { - flush_swap_writer(&handle); - printk("S"); - error = mark_swapfiles(swp_entry(root_swap, start)); - printk("|\n"); + if (!error) + error = save_image(&handle, &snapshot, + header->pages - 1); + if (!error) { + flush_swap_writer(&handle); + printk("S"); + error = mark_swapfiles(swp_entry(root_swap, start)); + printk("|\n"); + } } if (error) free_all_swap_pages(root_swap, handle.bitmap);