mm/ sparse cleanups
Subsystems (3)
Fix the following sparse warnings from the mm directory.
The vread() and vwrite() calls have been added to the include/linux/vmalloc.h file, as they are used by drivers/char/mem.c. We do not bother exporting these as drivers/char/mem.c can only be built into the kernel.
All the rest have been marked static as they are only being used in their relevant files.
mm/slab.c:305:30: warning: symbol 'initkmem_list3' was not declared. Should it be static? mm/page_alloc.c:369:6: warning: symbol '__free_pages_ok' was not declared. Should it be static? mm/page_alloc.c:1138:6: warning: symbol '__get_page_state' was not declared. Should it be static? mm/page_alloc.c:1688:6: warning: symbol 'zone_init_free_lists' was not declared. Should it be static? mm/page_alloc.c:1699:6: warning: symbol 'zonetable_add' was not declared. Should it be static? mm/vmalloc.c:289:6: warning: symbol '__vunmap' was not declared. Should it be static? mm/vmalloc.c:521:6: warning: symbol 'vread' was not declared. Should it be static? mm/vmalloc.c:559:6: warning: symbol 'vwrite' was not declared. Should it be static?
include/linux/vmalloc.h +3 -0
@@ -54,6 +54,9 @@ extern int map_vm_area(struct vm_struct struct page ***pages);extern void unmap_vm_area (struct vm_struct *area); +extern long vread (char *buf,char *addr,unsigned long count); +extern long vwrite (char *buf,char *addr,unsigned long count); +/* * Internals. Dont't use.. */
mm/page_alloc.c +7 -6
@@ -366,7 +366,7 @@ free_pages_bulk(struct zone *zone, int creturn ret; } -void __free_pages_ok (struct page *page,unsigned int order) +static void __free_pages_ok (struct page *page,unsigned int order) {LIST_HEAD (list);int i;
@@ -1135,7 +1135,7 @@ EXPORT_SYMBOL(nr_pagecache);DEFINE_PER_CPU (long, nr_pagecache_local) =0 ;#endif -void __get_page_state (struct page_state *ret,int nr,cpumask_t *cpumask) +static void __get_page_state (struct page_state *ret,int nr,cpumask_t *cpumask) {int cpu =0 ;
@@ -1685,8 +1685,8 @@ void __init memmap_init_zone(unsigned lo } } -void zone_init_free_lists (struct pglist_data *pgdat,struct zone *zone, -unsigned long size) +static void zone_init_free_lists (struct pglist_data *pgdat,struct zone *zone, +unsigned long size) {int order;for (order =0 ; order <MAX_ORDER ; order++) {
@@ -1696,8 +1696,9 @@ void zone_init_free_lists(struct pglist_ }#define ZONETABLE_INDEX (x, zone_nr) ((x << ZONES_SHIFT) | zone_nr) -void zonetable_add (struct zone *zone,int nid,int zid,unsigned long pfn, -unsigned long size) + +static void zonetable_add (struct zone *zone,int nid,int zid, +unsigned long pfn,unsigned long size) {unsigned long snum =pfn_to_section_nr (pfn);unsigned long end =pfn_to_section_nr (pfn + size);
mm/slab.c +1 -1
@@ -302,7 +302,7 @@ struct kmem_list3 {* Need this for bootstrapping a per node allocator. */ #define NUM_INIT_LISTS (2 * MAX_NUMNODES + 1) -struct kmem_list3 __initdata initkmem_list3[NUM_INIT_LISTS ]; +static struct kmem_list3 __initdata initkmem_list3[NUM_INIT_LISTS ];#define CACHE_CACHE 0#define SIZE_AC 1#define SIZE_L3 (1 + MAX_NUMNODES)
mm/vmalloc.c +1 -1
@@ -286,7 +286,7 @@ struct vm_struct *remove_vm_area(void *areturn v; } -void __vunmap (void *addr,int deallocate_pages) +static void __vunmap (void *addr,int deallocate_pages) {struct vm_struct *area;