diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2019-05-14 18:43:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-14 22:52:49 -0400 |
commit | 7507c40258726ea7a07374db00e8b55a138de88c (patch) | |
tree | 34e0b11e3a8b19c3cfcbc8e46491eb33d978a944 | |
parent | ef4d6f6b275c498f8e5626c99dbeefdc5027f843 (diff) |
lib/test_vmalloc.c:test_func(): eliminate local `ret'
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>
-rw-r--r-- | lib/test_vmalloc.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c index f832b095afba..8bbefcaddfe8 100644 --- a/lib/test_vmalloc.c +++ b/lib/test_vmalloc.c | |||
@@ -384,12 +384,11 @@ static int test_func(void *private) | |||
384 | { | 384 | { |
385 | struct test_driver *t = private; | 385 | struct test_driver *t = private; |
386 | int random_array[ARRAY_SIZE(test_case_array)]; | 386 | int random_array[ARRAY_SIZE(test_case_array)]; |
387 | int index, i, j, ret; | 387 | int index, i, j; |
388 | ktime_t kt; | 388 | ktime_t kt; |
389 | u64 delta; | 389 | u64 delta; |
390 | 390 | ||
391 | ret = set_cpus_allowed_ptr(current, cpumask_of(t->cpu)); | 391 | if (set_cpus_allowed_ptr(current, cpumask_of(t->cpu)) < 0) |
392 | if (ret < 0) | ||
393 | pr_err("Failed to set affinity to %d CPU\n", t->cpu); | 392 | pr_err("Failed to set affinity to %d CPU\n", t->cpu); |
394 | 393 | ||
395 | for (i = 0; i < ARRAY_SIZE(test_case_array); i++) | 394 | for (i = 0; i < ARRAY_SIZE(test_case_array); i++) |
@@ -415,8 +414,7 @@ static int test_func(void *private) | |||
415 | 414 | ||
416 | kt = ktime_get(); | 415 | kt = ktime_get(); |
417 | for (j = 0; j < test_repeat_count; j++) { | 416 | for (j = 0; j < test_repeat_count; j++) { |
418 | ret = test_case_array[index].test_func(); | 417 | if (!test_case_array[index].test_func()) |
419 | if (!ret) | ||
420 | per_cpu_test_data[t->cpu][index].test_passed++; | 418 | per_cpu_test_data[t->cpu][index].test_passed++; |
421 | else | 419 | else |
422 | per_cpu_test_data[t->cpu][index].test_failed++; | 420 | per_cpu_test_data[t->cpu][index].test_failed++; |