Skip to content

Commit 29da654

Browse files
committed
Merge tag 'for-linus' of https://github.com/openrisc/linux
Pull OpenRISC updates from Stafford Horne: "Just a few cleanups and updates that were sent in: - Replace asm/fixmap.h with asm-generic version - Fix to move memblock setup up before it's used during init" * tag 'for-linus' of https://github.com/openrisc/linux: openrisc: Use asm-generic's version of fix_to_virt() & virt_to_fix() openrisc: Call setup_memory() earlier in the init sequence
2 parents 6d75c6f + 7f1e2fc commit 29da654

File tree

2 files changed

+4
-33
lines changed

2 files changed

+4
-33
lines changed

arch/openrisc/include/asm/fixmap.h

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -50,35 +50,6 @@ enum fixed_addresses {
5050
/* FIXADDR_BOTTOM might be a better name here... */
5151
#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
5252

53-
#define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT))
54-
#define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
55-
56-
/*
57-
* 'index to address' translation. If anyone tries to use the idx
58-
* directly without tranlation, we catch the bug with a NULL-deference
59-
* kernel oops. Illegal ranges of incoming indices are caught too.
60-
*/
61-
static __always_inline unsigned long fix_to_virt(const unsigned int idx)
62-
{
63-
/*
64-
* this branch gets completely eliminated after inlining,
65-
* except when someone tries to use fixaddr indices in an
66-
* illegal way. (such as mixing up address types or using
67-
* out-of-range indices).
68-
*
69-
* If it doesn't get removed, the linker will complain
70-
* loudly with a reasonably clear error message..
71-
*/
72-
if (idx >= __end_of_fixed_addresses)
73-
BUG();
74-
75-
return __fix_to_virt(idx);
76-
}
77-
78-
static inline unsigned long virt_to_fix(const unsigned long vaddr)
79-
{
80-
BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
81-
return __virt_to_fix(vaddr);
82-
}
53+
#include <asm-generic/fixmap.h>
8354

8455
#endif

arch/openrisc/kernel/setup.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,9 @@ void calibrate_delay(void)
255255

256256
void __init setup_arch(char **cmdline_p)
257257
{
258+
/* setup memblock allocator */
259+
setup_memory();
260+
258261
unflatten_and_copy_device_tree();
259262

260263
setup_cpuinfo();
@@ -278,9 +281,6 @@ void __init setup_arch(char **cmdline_p)
278281
}
279282
#endif
280283

281-
/* setup memblock allocator */
282-
setup_memory();
283-
284284
/* paging_init() sets up the MMU and marks all pages as reserved */
285285
paging_init();
286286

0 commit comments

Comments
 (0)