linux-erofs.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] staging: erofs: fixed -Wmissing-prototype warnings.
@ 2019-01-07 18:25 Jeremy Sowden
  2019-01-07 18:25 ` [PATCH 1/2] " Jeremy Sowden
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Jeremy Sowden @ 2019-01-07 18:25 UTC (permalink / raw)


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
head

Jeremy Sowden (2):
  staging: erofs: fixed -Wmissing-prototype warnings.
  staging: erofs: fixed -Wmissing-prototype warnings.

 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
-- 
2.20.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] staging: erofs: fixed -Wmissing-prototype warnings.
  2019-01-07 18:25 [PATCH 0/2] staging: erofs: fixed -Wmissing-prototype warnings Jeremy Sowden
@ 2019-01-07 18:25 ` Jeremy Sowden
  2019-01-07 18:25 ` [PATCH 2/2] " Jeremy Sowden
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Jeremy Sowden @ 2019-01-07 18:25 UTC (permalink / raw)


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(-)

diff --git a/drivers/staging/erofs/unzip_vle.c b/drivers/staging/erofs/unzip_vle.c
index 4ac1099a39c6..584612b47369 100644
--- a/drivers/staging/erofs/unzip_vle.c
+++ b/drivers/staging/erofs/unzip_vle.c
@@ -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);
diff --git a/drivers/staging/erofs/unzip_vle_lz4.c b/drivers/staging/erofs/unzip_vle_lz4.c
index 52797bd89da1..8e8d705a6861 100644
--- a/drivers/staging/erofs/unzip_vle_lz4.c
+++ b/drivers/staging/erofs/unzip_vle_lz4.c
@@ -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);
 
diff --git a/drivers/staging/erofs/utils.c b/drivers/staging/erofs/utils.c
index b535898ca753..fc30025ef101 100644
--- a/drivers/staging/erofs/utils.c
+++ b/drivers/staging/erofs/utils.c
@@ -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);
 
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] staging: erofs: fixed -Wmissing-prototype warnings.
  2019-01-07 18:25 [PATCH 0/2] staging: erofs: fixed -Wmissing-prototype warnings Jeremy Sowden
  2019-01-07 18:25 ` [PATCH 1/2] " Jeremy Sowden
@ 2019-01-07 18:25 ` Jeremy Sowden
  2019-01-08  1:46 ` [PATCH 0/2] " Gao Xiang
  2019-01-08  6:42 ` Greg Kroah-Hartman
  3 siblings, 0 replies; 7+ messages in thread
From: Jeremy Sowden @ 2019-01-07 18:25 UTC (permalink / raw)


Moved prototypes for two functions to 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(-)

diff --git a/drivers/staging/erofs/data.c b/drivers/staging/erofs/data.c
index 5a55f0bfdfbb..329fa4fa3e9c 100644
--- a/drivers/staging/erofs/data.c
+++ b/drivers/staging/erofs/data.c
@@ -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)
diff --git a/drivers/staging/erofs/internal.h b/drivers/staging/erofs/internal.h
index 49c587383315..192f4028d85d 100644
--- a/drivers/staging/erofs/internal.h
+++ b/drivers/staging/erofs/internal.h
@@ -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,
diff --git a/drivers/staging/erofs/utils.c b/drivers/staging/erofs/utils.c
index fc30025ef101..aed211cd5875 100644
--- a/drivers/staging/erofs/utils.c
+++ b/drivers/staging/erofs/utils.c
@@ -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);
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 0/2] staging: erofs: fixed -Wmissing-prototype warnings.
  2019-01-07 18:25 [PATCH 0/2] staging: erofs: fixed -Wmissing-prototype warnings Jeremy Sowden
  2019-01-07 18:25 ` [PATCH 1/2] " Jeremy Sowden
  2019-01-07 18:25 ` [PATCH 2/2] " Jeremy Sowden
@ 2019-01-08  1:46 ` Gao Xiang
  2019-01-08  9:08   ` Jeremy Sowden
  2019-01-08  6:42 ` Greg Kroah-Hartman
  3 siblings, 1 reply; 7+ messages in thread
From: Gao Xiang @ 2019-01-08  1:46 UTC (permalink / raw)


Hi Jeremy,

On 2019/1/8 2:25, Jeremy Sowden wrote:
> 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
> head

Is -Wmissing-prototypes required for the current linux kernel?
I cannot see this warning in my personal kernel compilation...

Functions your fix have already been added proper erofs prefix,
therefore it wouldn't pollute the global namespace:
z_erofs_vle_work_release
z_erofs_unzip_lz4
erofs_try_to_release_workgroup

erofs_workgroup_free_rcu
z_erofs_map_blocks_iter

some thought?

Thanks,
Gao Xiang

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 0/2] staging: erofs: fixed -Wmissing-prototype warnings.
  2019-01-07 18:25 [PATCH 0/2] staging: erofs: fixed -Wmissing-prototype warnings Jeremy Sowden
                   ` (2 preceding siblings ...)
  2019-01-08  1:46 ` [PATCH 0/2] " Gao Xiang
@ 2019-01-08  6:42 ` Greg Kroah-Hartman
  3 siblings, 0 replies; 7+ messages in thread
From: Greg Kroah-Hartman @ 2019-01-08  6:42 UTC (permalink / raw)


On Mon, Jan 07, 2019@06:25:14PM +0000, Jeremy Sowden wrote:
> 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
> head
> 
> Jeremy Sowden (2):
>   staging: erofs: fixed -Wmissing-prototype warnings.
>   staging: erofs: fixed -Wmissing-prototype warnings.

You sent two different patches that did different things, yet they had
identical subject lines :(

Please fix that up, and resend.

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 0/2] staging: erofs: fixed -Wmissing-prototype warnings.
  2019-01-08  1:46 ` [PATCH 0/2] " Gao Xiang
@ 2019-01-08  9:08   ` Jeremy Sowden
  2019-01-08  9:23     ` Gao Xiang
  0 siblings, 1 reply; 7+ messages in thread
From: Jeremy Sowden @ 2019-01-08  9:08 UTC (permalink / raw)


On 2019-01-08,@09:46:18 +0800, Gao Xiang wrote:
> On 2019/1/8 2:25, Jeremy Sowden wrote:
> > 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 head
>
> Is -Wmissing-prototypes required for the current linux kernel?
> I cannot see this warning in my personal kernel compilation...
>
> Functions your fix have already been added proper erofs prefix,
> therefore it wouldn't pollute the global namespace:
> z_erofs_vle_work_release
> z_erofs_unzip_lz4
> erofs_try_to_release_workgroup
>
> erofs_workgroup_free_rcu
> z_erofs_map_blocks_iter

There was a request for help to fix these warnings on the
driverdev-devel mailing list last Novemeber (I've also attached the
message):

  http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2018-November/128432.html

Currently, the flag is only enabled by passing W=1 to make, but since it
is useful, the idea is to fix all the current warnings and enable it in
the main build.

J.
-------------- next part --------------
An embedded message was scrubbed...
From: Borislav Petkov <bp@alien8.de>
Subject: HELP WANTED: Fix -Wmissing-prototypes warnings
Date: Fri, 9 Nov 2018 18:44:10 +0100
Size: 6710
URL: <http://lists.ozlabs.org/pipermail/linux-erofs/attachments/20190108/1c2a4ac1/attachment.mht>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 0/2] staging: erofs: fixed -Wmissing-prototype warnings.
  2019-01-08  9:08   ` Jeremy Sowden
@ 2019-01-08  9:23     ` Gao Xiang
  0 siblings, 0 replies; 7+ messages in thread
From: Gao Xiang @ 2019-01-08  9:23 UTC (permalink / raw)




On 2019/1/8 17:08, Jeremy Sowden wrote:
> On 2019-01-08,@09:46:18 +0800, Gao Xiang wrote:
>> On 2019/1/8 2:25, Jeremy Sowden wrote:
>>> 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 head
>> Is -Wmissing-prototypes required for the current linux kernel?
>> I cannot see this warning in my personal kernel compilation...
>>
>> Functions your fix have already been added proper erofs prefix,
>> therefore it wouldn't pollute the global namespace:
>> z_erofs_vle_work_release
>> z_erofs_unzip_lz4
>> erofs_try_to_release_workgroup
>>
>> erofs_workgroup_free_rcu
>> z_erofs_map_blocks_iter
> There was a request for help to fix these warnings on the
> driverdev-devel mailing list last Novemeber (I've also attached the
> message):
> 
>   http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2018-November/128432.html
> 
> Currently, the flag is only enabled by passing W=1 to make, but since it
> is useful, the idea is to fix all the current warnings and enable it in
> the main build.

OK, it is fine with me personally too since it has no logic change.
I will also take care of W=1 from now on, and thanks for your explanation ;)

Thanks,
Gao Xiang

> 
> J.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-01-08  9:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-07 18:25 [PATCH 0/2] staging: erofs: fixed -Wmissing-prototype warnings Jeremy Sowden
2019-01-07 18:25 ` [PATCH 1/2] " Jeremy Sowden
2019-01-07 18:25 ` [PATCH 2/2] " Jeremy Sowden
2019-01-08  1:46 ` [PATCH 0/2] " Gao Xiang
2019-01-08  9:08   ` Jeremy Sowden
2019-01-08  9:23     ` Gao Xiang
2019-01-08  6:42 ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).