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

mtd: sm_ftl: Staticize local symbols

These local symbols are used only in this file.
Fix the following sparse warnings:

drivers/mtd/sm_ftl.c:25:25: warning: symbol 'cache_flush_workqueue' was not declared. Should it be static?
drivers/mtd/sm_ftl.c:44:9: warning: symbol 'sm_attr_show' was not declared. Should it be static?
drivers/mtd/sm_ftl.c:57:24: warning: symbol 'sm_create_sysfs_attributes' was not declared. Should it be static?
drivers/mtd/sm_ftl.c:110:6: warning: symbol 'sm_delete_sysfs_attributes' was not declared. Should it be static?
drivers/mtd/sm_ftl.c:574:5: warning: symbol 'sm_get_media_info' was not declared. Should it be static?
drivers/mtd/sm_ftl.c:881:17: warning: symbol 'sm_get_zone' was not declared. Should it be static?
drivers/mtd/sm_ftl.c:902:6: warning: symbol 'sm_cache_init' was not declared. Should it be static?
drivers/mtd/sm_ftl.c:912:6: warning: symbol 'sm_cache_put' was not declared. Should it be static?
drivers/mtd/sm_ftl.c:920:5: warning: symbol 'sm_cache_get' was not declared. Should it be static?
drivers/mtd/sm_ftl.c:931:5: warning: symbol 'sm_cache_flush' was not declared. Should it be static?

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

authored by

Jingoo Han and committed by
David Woodhouse
582b2ffc a3d7ee9f

+10 -10
+10 -10
drivers/mtd/sm_ftl.c
··· 22 22 23 23 24 24 25 - struct workqueue_struct *cache_flush_workqueue; 25 + static struct workqueue_struct *cache_flush_workqueue; 26 26 27 27 static int cache_timeout = 1000; 28 28 module_param(cache_timeout, int, S_IRUGO); ··· 41 41 int len; 42 42 }; 43 43 44 - ssize_t sm_attr_show(struct device *dev, struct device_attribute *attr, 44 + static ssize_t sm_attr_show(struct device *dev, struct device_attribute *attr, 45 45 char *buf) 46 46 { 47 47 struct sm_sysfs_attribute *sm_attr = ··· 54 54 55 55 #define NUM_ATTRIBUTES 1 56 56 #define SM_CIS_VENDOR_OFFSET 0x59 57 - struct attribute_group *sm_create_sysfs_attributes(struct sm_ftl *ftl) 57 + static struct attribute_group *sm_create_sysfs_attributes(struct sm_ftl *ftl) 58 58 { 59 59 struct attribute_group *attr_group; 60 60 struct attribute **attributes; ··· 107 107 return NULL; 108 108 } 109 109 110 - void sm_delete_sysfs_attributes(struct sm_ftl *ftl) 110 + static void sm_delete_sysfs_attributes(struct sm_ftl *ftl) 111 111 { 112 112 struct attribute **attributes = ftl->disk_attributes->attrs; 113 113 int i; ··· 571 571 }; 572 572 /* Find out media parameters. 573 573 * This ideally has to be based on nand id, but for now device size is enough */ 574 - int sm_get_media_info(struct sm_ftl *ftl, struct mtd_info *mtd) 574 + static int sm_get_media_info(struct sm_ftl *ftl, struct mtd_info *mtd) 575 575 { 576 576 int i; 577 577 int size_in_megs = mtd->size / (1024 * 1024); ··· 878 878 } 879 879 880 880 /* Get and automatically initialize an FTL mapping for one zone */ 881 - struct ftl_zone *sm_get_zone(struct sm_ftl *ftl, int zone_num) 881 + static struct ftl_zone *sm_get_zone(struct sm_ftl *ftl, int zone_num) 882 882 { 883 883 struct ftl_zone *zone; 884 884 int error; ··· 899 899 /* ----------------- cache handling ------------------------------------------*/ 900 900 901 901 /* Initialize the one block cache */ 902 - void sm_cache_init(struct sm_ftl *ftl) 902 + static void sm_cache_init(struct sm_ftl *ftl) 903 903 { 904 904 ftl->cache_data_invalid_bitmap = 0xFFFFFFFF; 905 905 ftl->cache_clean = 1; ··· 909 909 } 910 910 911 911 /* Put sector in one block cache */ 912 - void sm_cache_put(struct sm_ftl *ftl, char *buffer, int boffset) 912 + static void sm_cache_put(struct sm_ftl *ftl, char *buffer, int boffset) 913 913 { 914 914 memcpy(ftl->cache_data + boffset, buffer, SM_SECTOR_SIZE); 915 915 clear_bit(boffset / SM_SECTOR_SIZE, &ftl->cache_data_invalid_bitmap); ··· 917 917 } 918 918 919 919 /* Read a sector from the cache */ 920 - int sm_cache_get(struct sm_ftl *ftl, char *buffer, int boffset) 920 + static int sm_cache_get(struct sm_ftl *ftl, char *buffer, int boffset) 921 921 { 922 922 if (test_bit(boffset / SM_SECTOR_SIZE, 923 923 &ftl->cache_data_invalid_bitmap)) ··· 928 928 } 929 929 930 930 /* Write the cache to hardware */ 931 - int sm_cache_flush(struct sm_ftl *ftl) 931 + static int sm_cache_flush(struct sm_ftl *ftl) 932 932 { 933 933 struct ftl_zone *zone; 934 934