nommu: Provide is_vmalloc_addr() stub.

Introduced in commit-id 9e2779fa281cfda13ac060753d674bbcaa23367e and
ifdef'ed out for nommu in 8ca3ed87db062201e1fa15b64a9214e193fc3a8a, both
approaches end up breaking the nommu build in different ways. An
impressive feat for a 2-liner.

Current is_vmalloc_addr() users fall in to two camps:

- Determining whether to use vfree()/kfree()
- Whether to do vmlist traversal (only /proc/kcore).

Since we don't support /proc/kcore on nommu, that leaves the
vfree()/kfree() determination use cases. nommu vfree() happens to be a
wrapper to kfree() anyways, so is_vmalloc_addr() can always return 0
and end up with the right behaviour.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Paul Mundt and committed by
Linus Torvalds
0738c4bb baadac8b

+10 -3
+10 -3
include/linux/mm.h
··· 235 struct page *vmalloc_to_page(const void *addr); 236 unsigned long vmalloc_to_pfn(const void *addr); 237 238 - #ifdef CONFIG_MMU 239 - /* Determine if an address is within the vmalloc range */ 240 static inline int is_vmalloc_addr(const void *x) 241 { 242 unsigned long addr = (unsigned long)x; 243 244 return addr >= VMALLOC_START && addr < VMALLOC_END; 245 - } 246 #endif 247 248 static inline struct page *compound_head(struct page *page) 249 {
··· 235 struct page *vmalloc_to_page(const void *addr); 236 unsigned long vmalloc_to_pfn(const void *addr); 237 238 + /* 239 + * Determine if an address is within the vmalloc range 240 + * 241 + * On nommu, vmalloc/vfree wrap through kmalloc/kfree directly, so there 242 + * is no special casing required. 243 + */ 244 static inline int is_vmalloc_addr(const void *x) 245 { 246 + #ifdef CONFIG_MMU 247 unsigned long addr = (unsigned long)x; 248 249 return addr >= VMALLOC_START && addr < VMALLOC_END; 250 + #else 251 + return 0; 252 #endif 253 + } 254 255 static inline struct page *compound_head(struct page *page) 256 {