Skip to content

Commit 9f86d62

Browse files
sjp38torvalds
authored andcommitted
mm/damon/vaddr-test: remove unnecessary variables
A couple of test functions in DAMON virtual address space monitoring primitives implementation has unnecessary damon_ctx variables. This commit removes those. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: SeongJae Park <[email protected]> Cc: Brendan Higgins <[email protected]> Cc: Shuah Khan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 044cd97 commit 9f86d62

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

mm/damon/vaddr-test.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ static void damon_do_test_apply_three_regions(struct kunit *test,
135135
struct damon_addr_range *three_regions,
136136
unsigned long *expected, int nr_expected)
137137
{
138-
struct damon_ctx *ctx = damon_new_ctx();
139138
struct damon_target *t;
140139
struct damon_region *r;
141140
int i;
@@ -145,7 +144,6 @@ static void damon_do_test_apply_three_regions(struct kunit *test,
145144
r = damon_new_region(regions[i * 2], regions[i * 2 + 1]);
146145
damon_add_region(r, t);
147146
}
148-
damon_add_target(ctx, t);
149147

150148
damon_va_apply_three_regions(t, three_regions);
151149

@@ -154,8 +152,6 @@ static void damon_do_test_apply_three_regions(struct kunit *test,
154152
KUNIT_EXPECT_EQ(test, r->ar.start, expected[i * 2]);
155153
KUNIT_EXPECT_EQ(test, r->ar.end, expected[i * 2 + 1]);
156154
}
157-
158-
damon_destroy_ctx(ctx);
159155
}
160156

161157
/*
@@ -298,17 +294,13 @@ static void damon_test_split_evenly_succ(struct kunit *test,
298294

299295
static void damon_test_split_evenly(struct kunit *test)
300296
{
301-
struct damon_ctx *c = damon_new_ctx();
302-
303297
KUNIT_EXPECT_EQ(test, damon_va_evenly_split_region(NULL, NULL, 5),
304298
-EINVAL);
305299

306300
damon_test_split_evenly_fail(test, 0, 100, 0);
307301
damon_test_split_evenly_succ(test, 0, 100, 10);
308302
damon_test_split_evenly_succ(test, 5, 59, 5);
309303
damon_test_split_evenly_fail(test, 5, 6, 2);
310-
311-
damon_destroy_ctx(c);
312304
}
313305

314306
static struct kunit_case damon_test_cases[] = {

0 commit comments

Comments
 (0)