Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: android: ion: mark symbols static where possible

We get 4 warnings when building kernel with W=1:
drivers/staging/android/ion/ion_carveout_heap.c:36:17: warning: no previous prototype for 'ion_carveout_allocate' [-Wmissing-prototypes]
drivers/staging/android/ion/ion_carveout_heap.c:50:6: warning: no previous prototype for 'ion_carveout_free' [-Wmissing-prototypes]
drivers/staging/android/ion/ion_of.c:28:5: warning: no previous prototype for 'ion_parse_dt_heap_common' [-Wmissing-prototypes]
drivers/staging/android/ion/ion_of.c:54:5: warning: no previous prototype for 'ion_setup_heap_common' [-Wmissing-prototypes]

In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
so this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Baoyou Xie and committed by
Greg Kroah-Hartman
252a2560 da2c0871

+11 -11
+5 -5
drivers/staging/android/ion/ion_carveout_heap.c
··· 33 33 ion_phys_addr_t base; 34 34 }; 35 35 36 - ion_phys_addr_t ion_carveout_allocate(struct ion_heap *heap, 37 - unsigned long size, 38 - unsigned long align) 36 + static ion_phys_addr_t ion_carveout_allocate(struct ion_heap *heap, 37 + unsigned long size, 38 + unsigned long align) 39 39 { 40 40 struct ion_carveout_heap *carveout_heap = 41 41 container_of(heap, struct ion_carveout_heap, heap); ··· 47 47 return offset; 48 48 } 49 49 50 - void ion_carveout_free(struct ion_heap *heap, ion_phys_addr_t addr, 51 - unsigned long size) 50 + static void ion_carveout_free(struct ion_heap *heap, ion_phys_addr_t addr, 51 + unsigned long size) 52 52 { 53 53 struct ion_carveout_heap *carveout_heap = 54 54 container_of(heap, struct ion_carveout_heap, heap);
+6 -6
drivers/staging/android/ion/ion_of.c
··· 25 25 #include "ion_priv.h" 26 26 #include "ion_of.h" 27 27 28 - int ion_parse_dt_heap_common(struct device_node *heap_node, 29 - struct ion_platform_heap *heap, 30 - struct ion_of_heap *compatible) 28 + static int ion_parse_dt_heap_common(struct device_node *heap_node, 29 + struct ion_platform_heap *heap, 30 + struct ion_of_heap *compatible) 31 31 { 32 32 int i; 33 33 ··· 51 51 return 0; 52 52 } 53 53 54 - int ion_setup_heap_common(struct platform_device *parent, 55 - struct device_node *heap_node, 56 - struct ion_platform_heap *heap) 54 + static int ion_setup_heap_common(struct platform_device *parent, 55 + struct device_node *heap_node, 56 + struct ion_platform_heap *heap) 57 57 { 58 58 int ret = 0; 59 59