Skip to contentSkip to conversation

power: swap: Assign a value when removing the 'error' definition

PATCH Applied Li zeming 2 participants 2 messages Oct 27, 2023 – Dec 11, 2023

Subsystems (2)
lore
Share & tools
lore

Li zeming

author
#0 lore raw

PATCH 1/1 power: swap: Assign a value when removing the 'error' definition

'error' first receives the function result before it is used, and it does not need to be assigned a value during definition.

---
 kernel/power/swap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/power/swap.c +1 -1
index 74edbce2320ba..90bb583c57bf7 100644
@@ -450,7 +450,7 @@ static int get_swap_writer(struct swap_map_handle *handle)
 static int swap_write_page(struct swap_map_handle *handle, void *buf,
 		struct hib_bio_batch *hb)
 {
-	int error = 0;
+	int error;
 	sector_t offset;
 
 	if (!handle->cur)
Signature · 1 line
2.18.2
maintainer Applied
#1 lore raw
Quoted 14 lines · Li zeming

'error' first receives the function result before it is used, and it does not need to be assigned a value during definition.

---
 kernel/power/swap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/power/swap.c +0 -0
index 74edbce2320ba..90bb583c57bf7 100644

kernel/power/swap.c static int get_swap_writer(struct swap_map_handle *handle)

Quoted 9 lines
kernel/power/swap.c +1 -2
@@ -450,7 +450,7 @@ static int get_swap_writer(struct swap_map_handle *handle)
 static int swap_write_page(struct swap_map_handle *handle, void *buf,
                struct hib_bio_batch *hb)
 {
-       int error = 0;
+       int error;
        sector_t offset;
 
        if (!handle->cur)
--

Applied as 6.8 material under a rewritten subject.

Thanks!