linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] power: snapshot: Optimize the error variable in the snapshot_write_next()
@ 2023-10-24  2:04 Li zeming
  2023-12-11 21:10 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Li zeming @ 2023-10-24  2:04 UTC (permalink / raw)
  To: rafael, len.brown, pavel; +Cc: linux-pm, linux-kernel, Li zeming

Assign a value when removing the definition for error, which is assigned
before use.

Signed-off-by: Li zeming <zeming@nfschina.com>
---
 kernel/power/snapshot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
index 87e9f7e2bdc05..40c141144c9a1 100644
--- a/kernel/power/snapshot.c
+++ b/kernel/power/snapshot.c
@@ -2776,7 +2776,7 @@ static void *get_buffer(struct memory_bitmap *bm, struct chain_allocator *ca)
 int snapshot_write_next(struct snapshot_handle *handle)
 {
 	static struct chain_allocator ca;
-	int error = 0;
+	int error;
 
 next:
 	/* Check if we have already loaded the entire image */
-- 
2.18.2


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

* Re: [PATCH] power: snapshot: Optimize the error variable in the snapshot_write_next()
  2023-10-24  2:04 [PATCH] power: snapshot: Optimize the error variable in the snapshot_write_next() Li zeming
@ 2023-12-11 21:10 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2023-12-11 21:10 UTC (permalink / raw)
  To: Li zeming; +Cc: rafael, len.brown, pavel, linux-pm, linux-kernel

On Tue, Oct 24, 2023 at 4:05 AM Li zeming <zeming@nfschina.com> wrote:
>
> Assign a value when removing the definition for error, which is assigned
> before use.
>
> Signed-off-by: Li zeming <zeming@nfschina.com>
> ---
>  kernel/power/snapshot.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
> index 87e9f7e2bdc05..40c141144c9a1 100644
> --- a/kernel/power/snapshot.c
> +++ b/kernel/power/snapshot.c
> @@ -2776,7 +2776,7 @@ static void *get_buffer(struct memory_bitmap *bm, struct chain_allocator *ca)
>  int snapshot_write_next(struct snapshot_handle *handle)
>  {
>         static struct chain_allocator ca;
> -       int error = 0;
> +       int error;
>
>  next:
>         /* Check if we have already loaded the entire image */
> --

Applied as 6.8 material with rewritten subject and changelog.

Thanks!

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

end of thread, other threads:[~2023-12-11 21:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-24  2:04 [PATCH] power: snapshot: Optimize the error variable in the snapshot_write_next() Li zeming
2023-12-11 21:10 ` 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).