Skip to contentSkip to conversation

kernel/power: Remove blk_status_to_errno in hib_wait_io

PATCH Applied Falla Coulibaly 2 participants 2 messages Aug 18, 2021 – Sep 15, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel/power: Remove blk_status_to_errno in hib_wait_io

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.

---
 kernel/power/swap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/power/swap.c +1 -1
index 3cb89baebc79..9ec418955556 100644
@@ -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;
 }
 
 /*
Signature · 1 line
2.32.0
maintainer Applied
#1 lore raw
Quoted 15 lines · Falla Coulibaly

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.

---
 kernel/power/swap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/power/swap.c +0 -0
index 3cb89baebc79..9ec418955556 100644

kernel/power/swap.c static blk_status_t hib_wait_io(struct hib_bio_batch *hb)

Quoted 9 lines
kernel/power/swap.c +1 -2
@@ -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!