Skip to content

Commit 51e99be

Browse files
committed
m68k: rename global variable vmalloc_end to m68k_vmalloc_end
On SUN3, m68k defines macro VMALLOC_END as unsigned long variable vmalloc_end which is adjusted from mmu_emu_init(). This becomes problematic if a local variables vmalloc_end is defined in some function (not very unlikely) and VMALLOC_END is used in the function - the function thinks its referencing the global VMALLOC_END value but would be referencing its own local vmalloc_end variable. Rename the global variable to m68k_vmlloc_end which is much less likely to be used as local variable name. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Roman Zippel <zippel@linux-m68k.org>
1 parent 50de1a8 commit 51e99be

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎arch/m68k/include/asm/pgtable_mm.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@
8383
#define VMALLOC_START (((unsigned long) high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
8484
#define VMALLOC_END KMAP_START
8585
#else
86-
extern unsigned long vmalloc_end;
86+
extern unsigned long m68k_vmalloc_end;
8787
#define VMALLOC_START 0x0f800000
88-
#define VMALLOC_END vmalloc_end
88+
#define VMALLOC_END m68k_vmalloc_end
8989
#endif /* CONFIG_SUN3 */
9090

9191
/* zero page used for uninitialized stuff */

‎arch/m68k/sun3/mmu_emu.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
** Globals
4646
*/
4747

48-
unsigned long vmalloc_end;
49-
EXPORT_SYMBOL(vmalloc_end);
48+
unsigned long m68k_vmalloc_end;
49+
EXPORT_SYMBOL(m68k_vmalloc_end);
5050

5151
unsigned long pmeg_vaddr[PMEGS_NUM];
5252
unsigned char pmeg_alloc[PMEGS_NUM];
@@ -172,8 +172,8 @@ void mmu_emu_init(unsigned long bootmem_end)
172172
#endif
173173
// the lowest mapping here is the end of our
174174
// vmalloc region
175-
if(!vmalloc_end)
176-
vmalloc_end = seg;
175+
if (!m68k_vmalloc_end)
176+
m68k_vmalloc_end = seg;
177177

178178
// mark the segmap alloc'd, and reserve any
179179
// of the first 0xbff pages the hardware is

0 commit comments

Comments
 (0)