2023-12-28 03:19:25

by Li kunyu

[permalink] [raw]
Subject: [PATCH] kernel: cpu: Remove unnecessary ‘0’ values from ret

The ret variable is assigned when it does not need to be defined, as it
has already been assigned before use.

Signed-off-by: Li kunyu <[email protected]>
---
kernel/cpu.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 6de7c6bb74eee..c1f331ddf0dc7 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -998,7 +998,7 @@ static int cpuhp_up_callbacks(unsigned int cpu, struct cpuhp_cpu_state *st,
enum cpuhp_state target)
{
enum cpuhp_state prev_state = st->state;
- int ret = 0;
+ int ret;

ret = cpuhp_invoke_callback_range(true, cpu, st, target);
if (ret) {
@@ -1402,7 +1402,7 @@ static int cpuhp_down_callbacks(unsigned int cpu, struct cpuhp_cpu_state *st,
enum cpuhp_state target)
{
enum cpuhp_state prev_state = st->state;
- int ret = 0;
+ int ret;

ret = cpuhp_invoke_callback_range(false, cpu, st, target);
if (ret) {
@@ -2488,7 +2488,7 @@ int __cpuhp_setup_state_cpuslocked(enum cpuhp_state state,
int (*teardown)(unsigned int cpu),
bool multi_instance)
{
- int cpu, ret = 0;
+ int cpu, ret;
bool dynstate;

lockdep_assert_cpus_held();
--
2.18.2