Skip to content

Commit ef10444

Browse files
arndbbrauner
authored andcommitted
procfs: consolidate arch_report_meminfo declaration
The arch_report_meminfo() function is provided by four architectures, with a __weak fallback in procfs itself. On architectures that don't have a custom version, the __weak version causes a warning because of the missing prototype. Remove the architecture specific prototypes and instead add one in linux/proc_fs.h. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Dave Hansen <dave.hansen@linux.intel.com> # for arch/x86 Acked-by: Helge Deller <deller@gmx.de> # parisc Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com> Message-Id: <20230516195834.551901-1-arnd@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 247c8d2 commit ef10444

8 files changed

Lines changed: 5 additions & 12 deletions

File tree

arch/parisc/include/asm/pgtable.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,9 +472,6 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
472472

473473
#define pte_same(A,B) (pte_val(A) == pte_val(B))
474474

475-
struct seq_file;
476-
extern void arch_report_meminfo(struct seq_file *m);
477-
478475
#endif /* !__ASSEMBLY__ */
479476

480477

arch/powerpc/include/asm/pgtable.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,6 @@ static inline bool is_ioremap_addr(const void *x)
165165

166166
return addr >= IOREMAP_BASE && addr < IOREMAP_END;
167167
}
168-
169-
struct seq_file;
170-
void arch_report_meminfo(struct seq_file *m);
171168
#endif /* CONFIG_PPC64 */
172169

173170
#endif /* __ASSEMBLY__ */

arch/s390/include/asm/pgtable.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ static inline void update_page_count(int level, long count)
4242
atomic_long_add(count, &direct_pages_count[level]);
4343
}
4444

45-
struct seq_file;
46-
void arch_report_meminfo(struct seq_file *m);
47-
4845
/*
4946
* The S390 doesn't have any external MMU info: the kernel page
5047
* tables contain all the necessary information.

arch/s390/mm/pageattr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Author(s): Jan Glauber <jang@linux.vnet.ibm.com>
55
*/
66
#include <linux/hugetlb.h>
7+
#include <linux/proc_fs.h>
78
#include <linux/vmalloc.h>
89
#include <linux/mm.h>
910
#include <asm/cacheflush.h>

arch/x86/include/asm/pgtable.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
extern pgd_t early_top_pgt[PTRS_PER_PGD];
2828
bool __init __early_make_pgtable(unsigned long address, pmdval_t pmd);
2929

30+
struct seq_file;
3031
void ptdump_walk_pgd_level(struct seq_file *m, struct mm_struct *mm);
3132
void ptdump_walk_pgd_level_debugfs(struct seq_file *m, struct mm_struct *mm,
3233
bool user);

arch/x86/include/asm/pgtable_types.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,9 +513,6 @@ extern void native_pagetable_init(void);
513513
#define native_pagetable_init paging_init
514514
#endif
515515

516-
struct seq_file;
517-
extern void arch_report_meminfo(struct seq_file *m);
518-
519516
enum pg_level {
520517
PG_LEVEL_NONE,
521518
PG_LEVEL_4K,

arch/x86/mm/pat/set_memory.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <linux/mm.h>
1010
#include <linux/interrupt.h>
1111
#include <linux/seq_file.h>
12+
#include <linux/proc_fs.h>
1213
#include <linux/debugfs.h>
1314
#include <linux/pfn.h>
1415
#include <linux/percpu.h>

include/linux/proc_fs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ int proc_pid_arch_status(struct seq_file *m, struct pid_namespace *ns,
158158
struct pid *pid, struct task_struct *task);
159159
#endif /* CONFIG_PROC_PID_ARCH_STATUS */
160160

161+
void arch_report_meminfo(struct seq_file *m);
162+
161163
#else /* CONFIG_PROC_FS */
162164

163165
static inline void proc_root_init(void)

0 commit comments

Comments
 (0)