lib/test_vmalloc.c:test_func(): eliminate local `ret'
authorAndrew Morton <akpm@linux-foundation.org>
Tue, 14 May 2019 22:43:30 +0000 (15:43 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 15 May 2019 02:52:49 +0000 (19:52 -0700)
Local 'ret' is unneeded and was poorly named: the variable `ret'
generally means the "the value which this function will return".

Cc: Roman Gushchin <guro@fb.com>
Cc: Uladzislau Rezki <urezki@gmail.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Thomas Garnier <thgarnie@google.com>
Cc: Oleksiy Avramchenko <oleksiy.avramchenko@sonymobile.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Joel Fernandes <joelaf@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/test_vmalloc.c

index f832b095afba011293b6a3da18a2170b55501325..8bbefcaddfe843f65dae4fcd7ac77867fc53eb18 100644 (file)
@@ -384,12 +384,11 @@ static int test_func(void *private)
 {
        struct test_driver *t = private;
        int random_array[ARRAY_SIZE(test_case_array)];
-       int index, i, j, ret;
+       int index, i, j;
        ktime_t kt;
        u64 delta;
 
-       ret = set_cpus_allowed_ptr(current, cpumask_of(t->cpu));
-       if (ret < 0)
+       if (set_cpus_allowed_ptr(current, cpumask_of(t->cpu)) < 0)
                pr_err("Failed to set affinity to %d CPU\n", t->cpu);
 
        for (i = 0; i < ARRAY_SIZE(test_case_array); i++)
@@ -415,8 +414,7 @@ static int test_func(void *private)
 
                kt = ktime_get();
                for (j = 0; j < test_repeat_count; j++) {
-                       ret = test_case_array[index].test_func();
-                       if (!ret)
+                       if (!test_case_array[index].test_func())
                                per_cpu_test_data[t->cpu][index].test_passed++;
                        else
                                per_cpu_test_data[t->cpu][index].test_failed++;