fs/fat: Remove unnecessary wrapper fat_max_cache()
PATCH 1/1 fs/fat: Remove unnecessary wrapper fat_max_cache()
fat_max_cache() always returned FAT_MAX_CACHE and did not use the inode parameter. So, use the FAT_MAX_CACHE constant directly.
Signed-off-by Lalit Shankar Chowdhury <[email protected]>
--- fs/fat/cache.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
fs/fat/cache.c +1 -6
@@ -29,11 +29,6 @@ struct fat_cache_id {int dcluster; }; -static inline int fat_max_cache (struct inode *inode) -{ -return FAT_MAX_CACHE ; -} -static struct kmem_cache *fat_cache_cachep;static void init_once (void *foo)
@@ -145,7 +140,7 @@ static void fat_cache_add(struct inode *inode, struct fat_cache_id *new) cache =fat_cache_merge (inode, new);if (cache ==NULL ) { -if (MSDOS_I (inode)->nr_caches <fat_max_cache (inode)) { +if (MSDOS_I (inode)->nr_caches <FAT_MAX_CACHE ) {MSDOS_I (inode)->nr_caches++;spin_unlock (&MSDOS_I (inode)->cache_lru_lock);
Signature · 1 line
2.43.0
Quoted 4 lines · Lalit Shankar Chowdhury
fat_max_cache()always returnedFAT_MAX_CACHEand did not use the inode parameter. So, use theFAT_MAX_CACHEconstant directly.Signed-off-by Lalit Shankar Chowdhury <[email protected]>
Looks good.
Acked-by OGAWA Hirofumi <[email protected]>
Quoted 28 lines
--- fs/fat/cache.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)fs/fat/cache.c +1
-6@@ -29,11 +29,6 @@ struct fat_cache_id {int dcluster; }; -static inline int fat_max_cache (struct inode *inode) -{ -return FAT_MAX_CACHE ; -} -static struct kmem_cache *fat_cache_cachep;static void init_once (void *foo)@@ -145,7 +140,7 @@ static void fat_cache_add(struct inode *inode, struct fat_cache_id *new) cache =fat_cache_merge (inode, new);if (cache ==NULL ) { -if (MSDOS_I (inode)->nr_caches <fat_max_cache (inode)) { +if (MSDOS_I (inode)->nr_caches <FAT_MAX_CACHE ) {MSDOS_I (inode)->nr_caches++;spin_unlock (&MSDOS_I (inode)->cache_lru_lock);
Signature · 1 line
OGAWA Hirofumi <[email protected]>