Skip to content

Commit 55122e0

Browse files
committed
memblock tests: fix warning ‘struct seq_file’ declared inside parameter list
Building memblock tests produces the following warning: cc -I. -I../../include -Wall -O2 -fsanitize=address -fsanitize=undefined -D CONFIG_PHYS_ADDR_T_64BIT -c -o main.o main.c In file included from tests/common.h:9, from tests/basic_api.h:5, from main.c:2: ./linux/memblock.h:601:50: warning: ‘struct seq_file’ declared inside parameter list will not be visible outside of this definition or declaration 601 | static inline void memtest_report_meminfo(struct seq_file *m) { } | ^~~~~~~~ Add declaration of 'struct seq_file' to tools/include/linux/seq_file.h to fix it. Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
1 parent 5e1bffb commit 55122e0

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

tools/include/linux/seq_file.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#ifndef _TOOLS_INCLUDE_LINUX_SEQ_FILE_H
22
#define _TOOLS_INCLUDE_LINUX_SEQ_FILE_H
33

4+
struct seq_file;
5+
46
#endif /* _TOOLS_INCLUDE_LINUX_SEQ_FILE_H */

tools/testing/memblock/tests/basic_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
2+
#include "basic_api.h"
23
#include <string.h>
34
#include <linux/memblock.h>
4-
#include "basic_api.h"
55

66
#define EXPECTED_MEMBLOCK_REGIONS 128
77
#define FUNC_ADD "memblock_add"

tools/testing/memblock/tests/common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <stdlib.h>
66
#include <assert.h>
77
#include <linux/types.h>
8+
#include <linux/seq_file.h>
89
#include <linux/memblock.h>
910
#include <linux/sizes.h>
1011
#include <linux/printk.h>

0 commit comments

Comments
 (0)