Skip to content

Commit

Permalink
memblock tests: fix warning ‘struct seq_file’ declared inside paramet…
Browse files Browse the repository at this point in the history
…er list

[ Upstream commit 55122e0 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
rppt authored and gregkh committed Oct 6, 2023
1 parent 729757f commit 1c88886
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tools/include/linux/seq_file.h
Original file line number Diff line number Diff line change
@@ -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 */
2 changes: 1 addition & 1 deletion tools/testing/memblock/tests/basic_api.c
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
1 change: 1 addition & 0 deletions tools/testing/memblock/tests/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 1c88886

Please sign in to comment.