diff mbox series

kernel/power: Remove blk_status_to_errno in hib_wait_io

Message ID 20210818214740.3743-1-fallacoulibalyz@gmail.com
State Accepted
Commit 5416da01ff6e7275f9a4cfd7ff99e6b12b8dc2a8
Headers show
Series kernel/power: Remove blk_status_to_errno in hib_wait_io | expand

Commit Message

Falla Coulibaly Aug. 18, 2021, 9:47 p.m. UTC
blk_status_to_errno doesn't appear to perform extra work besides
converting blk_status_t to integer. This patch removes that unnecessary
conversion as the return type of the function is blk_status_t.

Signed-off-by: Falla Coulibaly <fallacoulibalyz@gmail.com>
---
 kernel/power/swap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Rafael J. Wysocki Sept. 15, 2021, 12:18 p.m. UTC | #1
On Wed, Aug 18, 2021 at 11:48 PM Falla Coulibaly
<fallacoulibalyz@gmail.com> wrote:
>

> blk_status_to_errno doesn't appear to perform extra work besides

> converting blk_status_t to integer. This patch removes that unnecessary

> conversion as the return type of the function is blk_status_t.

>

> Signed-off-by: Falla Coulibaly <fallacoulibalyz@gmail.com>

> ---

>  kernel/power/swap.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

>

> diff --git a/kernel/power/swap.c b/kernel/power/swap.c

> index 3cb89baebc79..9ec418955556 100644

> --- a/kernel/power/swap.c

> +++ b/kernel/power/swap.c

> @@ -306,7 +306,7 @@ static blk_status_t hib_wait_io(struct hib_bio_batch *hb)

>          * a plug will flush the plug list before sleeping.

>          */

>         wait_event(hb->wait, atomic_read(&hb->count) == 0);

> -       return blk_status_to_errno(hb->error);

> +       return hb->error;

>  }

>

>  /*

> --


Applied as 5.16 material, thanks!
diff mbox series

Patch

diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index 3cb89baebc79..9ec418955556 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -306,7 +306,7 @@  static blk_status_t hib_wait_io(struct hib_bio_batch *hb)
 	 * a plug will flush the plug list before sleeping.
 	 */
 	wait_event(hb->wait, atomic_read(&hb->count) == 0);
-	return blk_status_to_errno(hb->error);
+	return hb->error;
 }
 
 /*