Skip to content

Commit

Permalink
lib/test_vmalloc.c:test_func(): eliminate local `ret'
Browse files Browse the repository at this point in the history
Local 'ret' is unneeded and was poorly named: the variable `ret'
generally means the "the value which this function will return".

Cc: Roman Gushchin <[email protected]>
Cc: Uladzislau Rezki <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Thomas Garnier <[email protected]>
Cc: Oleksiy Avramchenko <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Joel Fernandes <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Tejun Heo <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
akpm00 authored and torvalds committed May 15, 2019
1 parent ef4d6f6 commit 7507c40
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/test_vmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
Expand All @@ -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++;
Expand Down

0 comments on commit 7507c40

Please sign in to comment.