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

Message ID 20231228031750.12941-1-kunyu@nfschina.com
State New
Headers
Series kernel: cpu: Remove unnecessary ‘0’ values from ret |

Commit Message

Li kunyu Dec. 28, 2023, 3:17 a.m. UTC
  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 <kunyu@nfschina.com>
---
 kernel/cpu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Patch

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();