[PATCH] jffs2: mark __jffs2_dbg_superblock_counts() static

Arnd Bergmann posted 1 patch 2 years, 8 months ago
fs/jffs2/debug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] jffs2: mark __jffs2_dbg_superblock_counts() static
Posted by Arnd Bergmann 2 years, 8 months ago
From: Arnd Bergmann <arnd@arndb.de>

This function is only called locally and does not need to be
global. Since there is no external prototype, gcc warns about
the non-static definition:

fs/jffs2/debug.c:160:6: error: no previous prototype for '__jffs2_dbg_superblock_counts' [-Werror=missing-prototypes]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/jffs2/debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/jffs2/debug.c b/fs/jffs2/debug.c
index 9d26b1b9fc01..0925caab23c4 100644
--- a/fs/jffs2/debug.c
+++ b/fs/jffs2/debug.c
@@ -157,7 +157,7 @@ __jffs2_dbg_prewrite_paranoia_check(struct jffs2_sb_info *c,
 	kfree(buf);
 }
 
-void __jffs2_dbg_superblock_counts(struct jffs2_sb_info *c)
+static void __jffs2_dbg_superblock_counts(struct jffs2_sb_info *c)
 {
 	struct jffs2_eraseblock *jeb;
 	uint32_t free = 0, dirty = 0, used = 0, wasted = 0,
-- 
2.39.2
Re: [PATCH] jffs2: mark __jffs2_dbg_superblock_counts() static
Posted by Tudor Ambarus 2 years, 8 months ago

On 5/17/23 14:27, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> This function is only called locally and does not need to be
> global. Since there is no external prototype, gcc warns about
> the non-static definition:
> 
> fs/jffs2/debug.c:160:6: error: no previous prototype for '__jffs2_dbg_superblock_counts' [-Werror=missing-prototypes]
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>

> ---
>  fs/jffs2/debug.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/jffs2/debug.c b/fs/jffs2/debug.c
> index 9d26b1b9fc01..0925caab23c4 100644
> --- a/fs/jffs2/debug.c
> +++ b/fs/jffs2/debug.c
> @@ -157,7 +157,7 @@ __jffs2_dbg_prewrite_paranoia_check(struct jffs2_sb_info *c,
>  	kfree(buf);
>  }
>  
> -void __jffs2_dbg_superblock_counts(struct jffs2_sb_info *c)
> +static void __jffs2_dbg_superblock_counts(struct jffs2_sb_info *c)
>  {
>  	struct jffs2_eraseblock *jeb;
>  	uint32_t free = 0, dirty = 0, used = 0, wasted = 0,