Skip to content

Commit 7b82e90

Browse files
committed
Merge tag 'asm-generic-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic
Pull asm-generic updates from Arnd Bergmann: "These are cleanups for architecture specific header files: - the comments in include/linux/syscalls.h have gone out of sync and are really pointless, so these get removed - The asm/bitsperlong.h header no longer needs to be architecture specific on modern compilers, so use a generic version for newer architectures that use new enough userspace compilers - A cleanup for virt_to_pfn/virt_to_bus to have proper type checking, forcing the use of pointers" * tag 'asm-generic-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic: syscalls: Remove file path comments from headers tools arch: Remove uapi bitsperlong.h of hexagon and microblaze asm-generic: Unify uapi bitsperlong.h for arm64, riscv and loongarch m68k/mm: Make pfn accessors static inlines arm64: memory: Make virt_to_pfn() a static inline ARM: mm: Make virt_to_pfn() a static inline asm-generic/page.h: Make pfn accessors static inlines xen/netback: Pass (void *) to virt_to_page() netfs: Pass a pointer to virt_to_page() cifs: Pass a pointer to virt_to_page() in cifsglob cifs: Pass a pointer to virt_to_page() riscv: mm: init: Pass a pointer to virt_to_page() ARC: init: Pass a pointer to virt_to_pfn() in init m68k: Pass a pointer to virt_to_pfn() virt_to_page() fs/proc/kcore.c: Pass a pointer to virt_addr_valid()
2 parents 9f57c13 + 4dd595c commit 7b82e90

80 files changed

Lines changed: 218 additions & 716 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

arch/arc/mm/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void __init setup_arch_memory(void)
8787
setup_initial_init_mm(_text, _etext, _edata, _end);
8888

8989
/* first page of system - kernel .vector starts here */
90-
min_low_pfn = virt_to_pfn(CONFIG_LINUX_RAM_BASE);
90+
min_low_pfn = virt_to_pfn((void *)CONFIG_LINUX_RAM_BASE);
9191

9292
/* Last usable page of low mem */
9393
max_low_pfn = max_pfn = PFN_DOWN(low_mem_start + low_mem_sz);

arch/arm/common/sharpsl_param.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <linux/module.h>
1212
#include <linux/string.h>
1313
#include <asm/mach/sharpsl_param.h>
14-
#include <asm/memory.h>
14+
#include <asm/page.h>
1515

1616
/*
1717
* Certain hardware parameters determined at the time of device manufacture,

arch/arm/include/asm/delay.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#ifndef __ASM_ARM_DELAY_H
88
#define __ASM_ARM_DELAY_H
99

10-
#include <asm/memory.h>
10+
#include <asm/page.h>
1111
#include <asm/param.h> /* HZ */
1212

1313
/*

arch/arm/include/asm/io.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <linux/string.h>
2424
#include <linux/types.h>
2525
#include <asm/byteorder.h>
26-
#include <asm/memory.h>
26+
#include <asm/page.h>
2727
#include <asm-generic/pci_iomap.h>
2828

2929
/*

arch/arm/include/asm/memory.h

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@
55
* Copyright (C) 2000-2002 Russell King
66
* modification for nommu, Hyok S. Choi, 2004
77
*
8-
* Note: this file should not be included by non-asm/.h files
8+
* Note: this file should not be included explicitly, include <asm/page.h>
9+
* to get access to these definitions.
910
*/
1011
#ifndef __ASM_ARM_MEMORY_H
1112
#define __ASM_ARM_MEMORY_H
1213

14+
#ifndef _ASMARM_PAGE_H
15+
#error "Do not include <asm/memory.h> directly"
16+
#endif
17+
1318
#include <linux/compiler.h>
1419
#include <linux/const.h>
1520
#include <linux/types.h>
@@ -288,10 +293,12 @@ static inline unsigned long __phys_to_virt(phys_addr_t x)
288293

289294
#endif
290295

291-
#define virt_to_pfn(kaddr) \
292-
((((unsigned long)(kaddr) - PAGE_OFFSET) >> PAGE_SHIFT) + \
293-
PHYS_PFN_OFFSET)
294-
296+
static inline unsigned long virt_to_pfn(const void *p)
297+
{
298+
unsigned long kaddr = (unsigned long)p;
299+
return (((kaddr - PAGE_OFFSET) >> PAGE_SHIFT) +
300+
PHYS_PFN_OFFSET);
301+
}
295302
#define __pa_symbol_nodebug(x) __virt_to_phys_nodebug((x))
296303

297304
#ifdef CONFIG_DEBUG_VIRTUAL

arch/arm/include/asm/page.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,10 @@ extern int pfn_valid(unsigned long);
183183
#define pfn_valid pfn_valid
184184
#endif
185185

186-
#include <asm/memory.h>
187-
188186
#endif /* !__ASSEMBLY__ */
189187

188+
#include <asm/memory.h>
189+
190190
#define VM_DATA_DEFAULT_FLAGS VM_DATA_FLAGS_TSK_EXEC
191191

192192
#include <asm-generic/getorder.h>

arch/arm/include/asm/pgtable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extern struct page *empty_zero_page;
2727
#else
2828

2929
#include <asm-generic/pgtable-nopud.h>
30-
#include <asm/memory.h>
30+
#include <asm/page.h>
3131
#include <asm/pgtable-hwdef.h>
3232

3333

arch/arm/include/asm/proc-fns.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,6 @@ static inline void init_proc_vtable(const struct processor *p)
147147

148148
extern void cpu_resume(void);
149149

150-
#include <asm/memory.h>
151-
152150
#ifdef CONFIG_MMU
153151

154152
#define cpu_switch_mm(pgd,mm) cpu_do_switch_mm(virt_to_phys(pgd),mm)

arch/arm/include/asm/sparsemem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#ifndef ASMARM_SPARSEMEM_H
33
#define ASMARM_SPARSEMEM_H
44

5-
#include <asm/memory.h>
5+
#include <asm/page.h>
66

77
/*
88
* Two definitions are required for sparsemem:

arch/arm/include/asm/uaccess-asm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include <asm/asm-offsets.h>
77
#include <asm/domain.h>
8-
#include <asm/memory.h>
8+
#include <asm/page.h>
99
#include <asm/thread_info.h>
1010

1111
.macro csdb

0 commit comments

Comments
 (0)