* [PATCH] power: hibernate: optimize function structure
@ 2023-01-12 5:24 Li kunyu
2023-01-20 16:45 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: Li kunyu @ 2023-01-12 5:24 UTC (permalink / raw)
To: rafael, pavel, tglx, mingo, bp, dave.hansen
Cc: x86, hpa, linux-pm, linux-kernel, Li kunyu
The goto statement jump is not required at the end of the if statement
block, because it will be executed to the lower part of the goto
statement.
Signed-off-by: Li kunyu <kunyu@nfschina.com>
---
arch/x86/power/hibernate.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/x86/power/hibernate.c b/arch/x86/power/hibernate.c
index 6f955eb1e163..936558c4e821 100644
--- a/arch/x86/power/hibernate.c
+++ b/arch/x86/power/hibernate.c
@@ -210,8 +210,6 @@ int arch_resume_nosmt(void)
if (ret)
goto out;
ret = cpuhp_smt_disable(old);
- if (ret)
- goto out;
}
out:
cpu_hotplug_disable();
--
2.18.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] power: hibernate: optimize function structure
2023-01-12 5:24 [PATCH] power: hibernate: optimize function structure Li kunyu
@ 2023-01-20 16:45 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2023-01-20 16:45 UTC (permalink / raw)
To: Li kunyu
Cc: rafael, pavel, tglx, mingo, bp, dave.hansen, x86, hpa, linux-pm,
linux-kernel
On Thu, Jan 12, 2023 at 6:25 AM Li kunyu <kunyu@nfschina.com> wrote:
>
> The goto statement jump is not required at the end of the if statement
> block, because it will be executed to the lower part of the goto
> statement.
>
> Signed-off-by: Li kunyu <kunyu@nfschina.com>
The patch itself is OK, but its subject should be something like "PM:
hibernate: x86: Drop unneeded goto statement from arch_resume_nosmt()"
and the changelog should be more precise, for example:
"The last goto statement in arch_resume_nosmt() is not necessary,
because the target label is right next to it."
Please update.
> ---
> arch/x86/power/hibernate.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/arch/x86/power/hibernate.c b/arch/x86/power/hibernate.c
> index 6f955eb1e163..936558c4e821 100644
> --- a/arch/x86/power/hibernate.c
> +++ b/arch/x86/power/hibernate.c
> @@ -210,8 +210,6 @@ int arch_resume_nosmt(void)
> if (ret)
> goto out;
> ret = cpuhp_smt_disable(old);
> - if (ret)
> - goto out;
> }
> out:
> cpu_hotplug_disable();
> --
> 2.18.2
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-01-20 16:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-12 5:24 [PATCH] power: hibernate: optimize function structure Li kunyu
2023-01-20 16:45 ` 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).