* [PATCH] power: swap: Assign a value when removing the 'error' definition
@ 2023-10-27 1:55 Li zeming
2023-12-11 21:07 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: Li zeming @ 2023-10-27 1:55 UTC (permalink / raw)
To: rafael, pavel, len.brown; +Cc: linux-pm, linux-kernel, Li zeming
'error' first receives the function result before it is used, and it
does not need to be assigned a value during definition.
Signed-off-by: Li zeming <zeming@nfschina.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 74edbce2320ba..90bb583c57bf7 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -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)
--
2.18.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] power: swap: Assign a value when removing the 'error' definition
2023-10-27 1:55 [PATCH] power: swap: Assign a value when removing the 'error' definition Li zeming
@ 2023-12-11 21:07 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2023-12-11 21:07 UTC (permalink / raw)
To: Li zeming; +Cc: rafael, pavel, len.brown, linux-pm, linux-kernel
On Fri, Oct 27, 2023 at 3:56 AM Li zeming <zeming@nfschina.com> wrote:
>
> 'error' first receives the function result before it is used, and it
> does not need to be assigned a value during definition.
>
> Signed-off-by: Li zeming <zeming@nfschina.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 74edbce2320ba..90bb583c57bf7 100644
> --- a/kernel/power/swap.c
> +++ b/kernel/power/swap.c
> @@ -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!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-12-11 21:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-27 1:55 [PATCH] power: swap: Assign a value when removing the 'error' definition Li zeming
2023-12-11 21:07 ` 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).