summaryrefslogtreecommitdiff
path: root/kernel/power
diff options
context:
space:
mode:
authorAnders Roxell <anders.roxell@linaro.org>2021-10-07 22:13:37 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-11-18 21:16:38 +0300
commit8f74e6d5161ea9d8189535a45144615c1e48cb61 (patch)
tree1aac74c7a43f1d2926d5c919fcaa938b5a66276a /kernel/power
parentff950ae83201efeafdd440eac798201fd7e3f8cb (diff)
downloadlinux-8f74e6d5161ea9d8189535a45144615c1e48cb61.tar.xz
PM: hibernate: fix sparse warnings
[ Upstream commit 01de5fcd8b1ac0ca28d2bb0921226a54fdd62684 ] When building the kernel with sparse enabled 'C=1' the following warnings shows up: kernel/power/swap.c:390:29: warning: incorrect type in assignment (different base types) kernel/power/swap.c:390:29: expected int ret kernel/power/swap.c:390:29: got restricted blk_status_t This is due to function hib_wait_io() returns a 'blk_status_t' which is a bitwise u8. Commit 5416da01ff6e ("PM: hibernate: Remove blk_status_to_errno in hib_wait_io") seemed to have mixed up the return type. However, the 4e4cbee93d56 ("block: switch bios to blk_status_t") actually broke the behaviour by returning the wrong type. Rework so function hib_wait_io() returns a 'int' instead of 'blk_status_t' and make sure to call function blk_status_to_errno(hb->error)' when returning from function hib_wait_io() a int gets returned. Fixes: 4e4cbee93d56 ("block: switch bios to blk_status_t") Fixes: 5416da01ff6e ("PM: hibernate: Remove blk_status_to_errno in hib_wait_io") Signed-off-by: Anders Roxell <anders.roxell@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/swap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index 0aabc94125d6..f3a1086f7cdb 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -299,7 +299,7 @@ static int hib_submit_io(int op, int op_flags, pgoff_t page_off, void *addr,
return error;
}
-static blk_status_t hib_wait_io(struct hib_bio_batch *hb)
+static int hib_wait_io(struct hib_bio_batch *hb)
{
/*
* We are relying on the behavior of blk_plug that a thread with