memblock tests: fix warning ‘struct seq_file’ declared inside parameter list
authorMike Rapoport (IBM) <rppt@kernel.org>
Thu, 14 Sep 2023 07:45:40 +0000 (10:45 +0300)
committerMike Rapoport (IBM) <rppt@kernel.org>
Thu, 14 Sep 2023 07:51:28 +0000 (10:51 +0300)
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>
tools/include/linux/seq_file.h
tools/testing/memblock/tests/basic_api.c
tools/testing/memblock/tests/common.h

index 102fd9217f1f9b96438f14e7d9ef643d123ebc43..f6bc226af0c1d1c4d26c1c2d3f7a963c34c728eb 100644 (file)
@@ -1,4 +1,6 @@
 #ifndef _TOOLS_INCLUDE_LINUX_SEQ_FILE_H
 #define _TOOLS_INCLUDE_LINUX_SEQ_FILE_H
 
+struct seq_file;
+
 #endif /* _TOOLS_INCLUDE_LINUX_SEQ_FILE_H */
index 411647094cc37f832ecc69c829a57036a800c9db..57bf2688edfd68ca8dbc5724da1e78aff9897e59 100644 (file)
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
+#include "basic_api.h"
 #include <string.h>
 #include <linux/memblock.h>
-#include "basic_api.h"
 
 #define EXPECTED_MEMBLOCK_REGIONS                      128
 #define FUNC_ADD                                       "memblock_add"
index 4f23302ee6779a4b6b7e7007e2fea98b60094a4c..b5ec59aa62d72ab2ad3f51ffd5d2b4fb6722a8a3 100644 (file)
@@ -5,6 +5,7 @@
 #include <stdlib.h>
 #include <assert.h>
 #include <linux/types.h>
+#include <linux/seq_file.h>
 #include <linux/memblock.h>
 #include <linux/sizes.h>
 #include <linux/printk.h>