]> git.baikalelectronics.ru Git - kernel.git/commit
PM: hibernate: fix sparse warnings
authorAnders Roxell <anders.roxell@linaro.org>
Thu, 7 Oct 2021 19:13:37 +0000 (21:13 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 21 Oct 2021 10:45:18 +0000 (12:45 +0200)
commit734732c706819ca4d1a75e63641cba9c5a751fad
treef7a3f13fd73413a9dfa9c61f89c790ad51bb165b
parent2586979320e326baf27f6ea648cb6f627bb391f0
PM: hibernate: fix sparse warnings

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 1c14839ff744 ("PM: hibernate: Remove
blk_status_to_errno in hib_wait_io") seemed to have mixed up the return
type. However, the 10d7729f43f5 ("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: 10d7729f43f5 ("block: switch bios to blk_status_t")
Fixes: 1c14839ff744 ("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>
kernel/power/swap.c