LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] kernel/power: Remove blk_status_to_errno in hib_wait_io
@ 2021-08-18 21:47 Falla Coulibaly
  2021-09-15 12:18 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Falla Coulibaly @ 2021-08-18 21:47 UTC (permalink / raw)
  To: rjw, len.brown, pavel; +Cc: Falla Coulibaly, linux-pm, linux-kernel

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;
 }
 
 /*
-- 
2.32.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] kernel/power: Remove blk_status_to_errno in hib_wait_io
  2021-08-18 21:47 [PATCH] kernel/power: Remove blk_status_to_errno in hib_wait_io Falla Coulibaly
@ 2021-09-15 12:18 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2021-09-15 12:18 UTC (permalink / raw)
  To: Falla Coulibaly
  Cc: Rafael J. Wysocki, Len Brown, Pavel Machek, Linux PM,
	Linux Kernel Mailing List

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!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-15 12:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-18 21:47 [PATCH] kernel/power: Remove blk_status_to_errno in hib_wait_io Falla Coulibaly
2021-09-15 12:18 ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).