Skip to content

Commit

Permalink
[PATCH] swsusp warning fix
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Jul 10, 2006
1 parent 95018f7 commit 712f403
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions kernel/power/swap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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())) {
Expand All @@ -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);
Expand Down

0 comments on commit 712f403

Please sign in to comment.