Skip to contentSkip to conversation

kernel: cpu: Remove unnecessary ‘0’ values from ret

PATCH New Li kunyu 1 participant 1 message Dec 28, 2023 CPU hotplug

lore
Share & tools
lore

Li kunyu

author
#0 lore raw

PATCH 1/1 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.

---
 kernel/cpu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/cpu.c +3 -3
index 6de7c6bb74eee..c1f331ddf0dc7 100644
@@ -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();
Signature · 1 line
2.18.2