Skip to content

Commit 3afe733

Browse files
mattwuqmhiramat
authored andcommitted
lib: test_objpool: make global variables static
Kernel test robot reported build warnings that structures g_ot_sync_ops, g_ot_async_ops and g_testcases should be static. These definitions are only used in test_objpool.c, so make them static Link: https://lore.kernel.org/all/[email protected]/ Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: wuqiang.matt <[email protected]> Acked-by: Masami Hiramatsu (Google) <[email protected]> Signed-off-by: Masami Hiramatsu (Google) <[email protected]>
1 parent b2a8669 commit 3afe733

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/test_objpool.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ static void ot_fini_sync(struct ot_context *sop)
311311
ot_kfree(sop->test, sop, sizeof(*sop));
312312
}
313313

314-
struct {
314+
static struct {
315315
struct ot_context * (*init)(struct ot_test *oc);
316316
void (*fini)(struct ot_context *sop);
317317
} g_ot_sync_ops[] = {
@@ -475,7 +475,7 @@ static struct ot_context *ot_init_async_m0(struct ot_test *test)
475475
return sop;
476476
}
477477

478-
struct {
478+
static struct {
479479
struct ot_context * (*init)(struct ot_test *oc);
480480
void (*fini)(struct ot_context *sop);
481481
} g_ot_async_ops[] = {
@@ -632,7 +632,7 @@ static int ot_start_async(struct ot_test *test)
632632
#define NODE_COMPACT sizeof(struct ot_node)
633633
#define NODE_VMALLOC (512)
634634

635-
struct ot_test g_testcases[] = {
635+
static struct ot_test g_testcases[] = {
636636

637637
/* sync & normal */
638638
{0, 0, NODE_COMPACT, 1000, 0, 1, 0, 0, "sync: percpu objpool"},

0 commit comments

Comments
 (0)