Skip to contentSkip to conversation

staging: erofs: fixed -Wmissing-prototype warnings.

PATCH New Jeremy Sowden 1 participant 3 messages Jan 8, 2019 Staging

lore
Share & tools
lore
#0 lore raw

v2 cover staging: erofs: fixed -Wmissing-prototype warnings.

Fixes for -Wmissing-prototype warnings in the erofs driver. One group of functions have been made static; for the second, prototypes have been moved to a header file.

Changes since v1:

* amended commit messages to ensure distinct e-mail subjects.

Jeremy Sowden (2):
staging: erofs: fixed -Wmissing-prototype warnings by making functions
static.
staging: erofs: fixed -Wmissing-prototype warnings by moving
prototypes to header file.

 drivers/staging/erofs/data.c          |  6 ------
 drivers/staging/erofs/internal.h      |  7 +++++++
 drivers/staging/erofs/unzip_vle.c     |  2 +-
 drivers/staging/erofs/unzip_vle_lz4.c |  2 +-
 drivers/staging/erofs/utils.c         | 14 ++++++--------
 5 files changed, 15 insertions(+), 16 deletions(-)

base-commit: c8c2702409430a6a2fd928e857f15773aaafcc99

Signature · 1 line
2.20.1
#1 lore raw

PATCH v2 1/2 staging: erofs: fixed -Wmissing-prototype warnings by making functions static.

Define three functions which are not used outside their own translation-units as static in order to fix the following warnings:

drivers/staging/erofs/utils.c:134:6: warning: no previous prototype for ?erofs_try_to_release_workgroup? [-Wmissing-prototypes]
bool erofs_try_to_release_workgroup(struct erofs_sb_info *sbi,

        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

drivers/staging/erofs/unzip_vle.c:592:6: warning: no previous prototype for ?z_erofs_vle_work_release? [-Wmissing-prototypes]
void z_erofs_vle_work_release(struct z_erofs_vle_work *work)

        ^~~~~~~~~~~~~~~~~~~~~~~~

drivers/staging/erofs/unzip_vle_lz4.c:16:5: warning: no previous prototype for ?z_erofs_unzip_lz4? [-Wmissing-prototypes]
int z_erofs_unzip_lz4(void *in, void *out, size_t inlen, size_t outlen)

       ^~~~~~~~~~~~~~~~~
Signed-off-by Jeremy Sowden <jeremy at azazel.net>
---
 drivers/staging/erofs/unzip_vle.c     |  2 +-
 drivers/staging/erofs/unzip_vle_lz4.c |  2 +-
 drivers/staging/erofs/utils.c         | 12 ++++++------
 3 files changed, 8 insertions(+), 8 deletions(-)
drivers/staging/erofs/unzip_vle.c +1 -1
index 4ac1099a39c6..584612b47369 100644
@@ -589,7 +589,7 @@ static void __z_erofs_vle_work_release(struct z_erofs_vle_workgroup *grp,
 	erofs_workgroup_put(&grp->obj);
 }
 
-void z_erofs_vle_work_release(struct z_erofs_vle_work *work)
+static void z_erofs_vle_work_release(struct z_erofs_vle_work *work)
 {
 	struct z_erofs_vle_workgroup *grp =
 		z_erofs_vle_work_workgroup(work, true);
drivers/staging/erofs/unzip_vle_lz4.c +1 -1
index 52797bd89da1..8e8d705a6861 100644
@@ -13,7 +13,7 @@
 #include "unzip_vle.h"
 #include <linux/lz4.h>
 
-int z_erofs_unzip_lz4(void *in, void *out, size_t inlen, size_t outlen)
+static int z_erofs_unzip_lz4(void *in, void *out, size_t inlen, size_t outlen)
 {
 	int ret = LZ4_decompress_safe_partial(in, out, inlen, outlen, outlen);
 
drivers/staging/erofs/utils.c +6 -6
index b535898ca753..fc30025ef101 100644
@@ -131,9 +131,9 @@ static void erofs_workgroup_unfreeze_final(struct erofs_workgroup *grp)
 	__erofs_workgroup_free(grp);
 }
 
-bool erofs_try_to_release_workgroup(struct erofs_sb_info *sbi,
-				    struct erofs_workgroup *grp,
-				    bool cleanup)
+static bool erofs_try_to_release_workgroup(struct erofs_sb_info *sbi,
+					   struct erofs_workgroup *grp,
+					   bool cleanup)
 {
 	/*
 	 * for managed cache enabled, the refcount of workgroups
@@ -172,9 +172,9 @@ bool erofs_try_to_release_workgroup(struct erofs_sb_info *sbi,
 
 #else
 /* for nocache case, no customized reclaim path at all */
-bool erofs_try_to_release_workgroup(struct erofs_sb_info *sbi,
-				    struct erofs_workgroup *grp,
-				    bool cleanup)
+static bool erofs_try_to_release_workgroup(struct erofs_sb_info *sbi,
+					   struct erofs_workgroup *grp,
+					   bool cleanup)
 {
 	int cnt = atomic_read(&grp->refcount);
 
Signature · 1 line
2.20.1
#2 lore raw

PATCH v2 2/2 staging: erofs: fixed -Wmissing-prototype warnings by moving prototypes to header file.

In reply to Jeremy Sowden

Moved prototypes for two functions to a header file in order to fix the following warnings:

drivers/staging/erofs/unzip_vle.c:577:6: warning: no previous prototype for ?erofs_workgroup_free_rcu? [-Wmissing-prototypes]
void erofs_workgroup_free_rcu(struct erofs_workgroup *grp)

        ^~~~~~~~~~~~~~~~~~~~~~~~

drivers/staging/erofs/unzip_vle.c:1702:5: warning: no previous prototype for ?z_erofs_map_blocks_iter? [-Wmissing-prototypes]
int z_erofs_map_blocks_iter(struct inode *inode,

       ^~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by Jeremy Sowden <jeremy at azazel.net>
---
 drivers/staging/erofs/data.c     | 6 ------
 drivers/staging/erofs/internal.h | 7 +++++++
 drivers/staging/erofs/utils.c    | 2 --
 3 files changed, 7 insertions(+), 8 deletions(-)
drivers/staging/erofs/data.c +0 -6
index 5a55f0bfdfbb..329fa4fa3e9c 100644
@@ -165,12 +165,6 @@ static int erofs_map_blocks_flatmode(struct inode *inode,
 	return err;
 }
 
-#ifdef CONFIG_EROFS_FS_ZIP
-extern int z_erofs_map_blocks_iter(struct inode *,
-				   struct erofs_map_blocks *,
-				   struct page **, int);
-#endif
-
 int erofs_map_blocks_iter(struct inode *inode,
 			  struct erofs_map_blocks *map,
 			  struct page **mpage_ret, int flags)
drivers/staging/erofs/internal.h +7 -0
index 49c587383315..192f4028d85d 100644
@@ -288,6 +288,8 @@ static inline void erofs_workstation_cleanup_all(struct super_block *sb)
 	erofs_shrink_workstation(EROFS_SB(sb), ~0UL, true);
 }
 
+extern void erofs_workgroup_free_rcu(struct erofs_workgroup *grp);
+
 #ifdef EROFS_FS_HAS_MANAGED_CACHE
 extern int erofs_try_to_free_all_cached_pages(struct erofs_sb_info *sbi,
 	struct erofs_workgroup *egrp);
@@ -530,6 +532,11 @@ struct erofs_map_blocks_iter {
 	struct page *mpage;
 };
 
+#ifdef CONFIG_EROFS_FS_ZIP
+extern int z_erofs_map_blocks_iter(struct inode *,
+				   struct erofs_map_blocks *,
+				   struct page **, int);
+#endif
 
 static inline struct page *
 erofs_get_inline_page(struct inode *inode,
drivers/staging/erofs/utils.c +0 -2
index fc30025ef101..aed211cd5875 100644
@@ -104,8 +104,6 @@ int erofs_register_workgroup(struct super_block *sb,
 	return err;
 }
 
-extern void erofs_workgroup_free_rcu(struct erofs_workgroup *grp);
-
 static void  __erofs_workgroup_free(struct erofs_workgroup *grp)
 {
 	atomic_long_dec(&erofs_global_shrink_cnt);
Signature · 1 line
2.20.1