alpha: remove redundant err variable
authorMinghao Chi <chi.minghao@zte.com.cn>
Mon, 10 Jan 2022 01:29:54 +0000 (01:29 +0000)
committerMatt Turner <mattst88@gmail.com>
Tue, 14 Feb 2023 17:36:10 +0000 (12:36 -0500)
Return value from __hw_perf_event_init() directly instead
of taking this in another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: CGEL ZTE <cgel.zte@gmail.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
arch/alpha/kernel/perf_event.c

index efcf732..ccdb508 100644 (file)
@@ -689,8 +689,6 @@ static int __hw_perf_event_init(struct perf_event *event)
  */
 static int alpha_pmu_event_init(struct perf_event *event)
 {
-       int err;
-
        /* does not support taken branch sampling */
        if (has_branch_stack(event))
                return -EOPNOTSUPP;
@@ -709,9 +707,7 @@ static int alpha_pmu_event_init(struct perf_event *event)
                return -ENODEV;
 
        /* Do the real initialisation work. */
-       err = __hw_perf_event_init(event);
-
-       return err;
+       return __hw_perf_event_init(event);
 }
 
 /*