Skip to content

Commit

Permalink
PM: hibernate: Drop unused snapshot_test argument
Browse files Browse the repository at this point in the history
snapshot_test argument is now unused in swsusp_close() and
load_image_and_restore(). Drop it

CC: linux-pm@vger.kernel.org
Acked-by: Christoph Hellwig <hch@lst.de>
Acked-by: "Rafael J. Wysocki" <rafael@kernel.org>
Acked-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20230927093442.25915-17-jack@suse.cz
Signed-off-by: Christian Brauner <brauner@kernel.org>
  • Loading branch information
Jan Kara authored and Christian Brauner committed Oct 28, 2023
1 parent e017d30 commit 93745df
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions kernel/power/hibernate.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ static void power_down(void)
cpu_relax();
}

static int load_image_and_restore(bool snapshot_test)
static int load_image_and_restore(void)
{
int error;
unsigned int flags;
Expand All @@ -694,12 +694,12 @@ static int load_image_and_restore(bool snapshot_test)
lock_device_hotplug();
error = create_basic_memory_bitmaps();
if (error) {
swsusp_close(snapshot_test);
swsusp_close();
goto Unlock;
}

error = swsusp_read(&flags);
swsusp_close(snapshot_test);
swsusp_close();
if (!error)
error = hibernation_restore(flags & SF_PLATFORM_MODE);

Expand Down Expand Up @@ -788,7 +788,7 @@ int hibernate(void)
pm_pr_dbg("Checking hibernation image\n");
error = swsusp_check(false);
if (!error)
error = load_image_and_restore(false);
error = load_image_and_restore();
}
thaw_processes();

Expand Down Expand Up @@ -952,7 +952,7 @@ static int software_resume(void)
/* The snapshot device should not be opened while we're running */
if (!hibernate_acquire()) {
error = -EBUSY;
swsusp_close(true);
swsusp_close();
goto Unlock;
}

Expand All @@ -973,7 +973,7 @@ static int software_resume(void)
goto Close_Finish;
}

error = load_image_and_restore(true);
error = load_image_and_restore();
thaw_processes();
Finish:
pm_notifier_call_chain(PM_POST_RESTORE);
Expand All @@ -987,7 +987,7 @@ static int software_resume(void)
pm_pr_dbg("Hibernation image not present or could not be loaded.\n");
return error;
Close_Finish:
swsusp_close(true);
swsusp_close();
goto Finish;
}

Expand Down
2 changes: 1 addition & 1 deletion kernel/power/power.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ int swsusp_check(bool exclusive);
extern void swsusp_free(void);
extern int swsusp_read(unsigned int *flags_p);
extern int swsusp_write(unsigned int flags);
void swsusp_close(bool exclusive);
void swsusp_close(void);
#ifdef CONFIG_SUSPEND
extern int swsusp_unmark(void);
#endif
Expand Down
6 changes: 3 additions & 3 deletions kernel/power/swap.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ static int get_swap_writer(struct swap_map_handle *handle)
err_rel:
release_swap_writer(handle);
err_close:
swsusp_close(false);
swsusp_close();
return ret;
}

Expand Down Expand Up @@ -509,7 +509,7 @@ static int swap_writer_finish(struct swap_map_handle *handle,
if (error)
free_all_swap_pages(root_swap);
release_swap_writer(handle);
swsusp_close(false);
swsusp_close();

return error;
}
Expand Down Expand Up @@ -1569,7 +1569,7 @@ int swsusp_check(bool exclusive)
* @exclusive: Close the resume device which is exclusively opened.
*/

void swsusp_close(bool exclusive)
void swsusp_close(void)
{
if (IS_ERR(hib_resume_bdev_handle)) {
pr_debug("Image device not initialised\n");
Expand Down

0 comments on commit 93745df

Please sign in to comment.