Remove extra 'const' modifiers; they don't do anything.
PATCH 1/2 Remove extra 'const' modifiers; they don't do anything.
'const int const *x' means the same thing as 'const int *x' or 'int const *x'; the intent was probably 'const int * const x'. However, this won't work for the 'suffix' variable, as it has to be assigned, and making the static tables into const pointers to const chars leads to a mismatch there.
This was found with clang's duplicate-decl-specifier warning.
--- utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
utils.c +3 -3
@@ -1295,9 +1295,9 @@ out:return ret; } -static const char const *unit_suffix_binary[] = +static const char * unit_suffix_binary[] = {"B" ,"KiB" ,"MiB" ,"GiB" ,"TiB" ,"PiB" ,"EiB" }; -static const char const *unit_suffix_decimal[] = +static const char * unit_suffix_decimal[] = {"B" ,"KB" ,"MB" ,"GB" ,"TB" ,"PB" ,"EB" };int pretty_size_snprintf (u64 size,char *str,size_t str_size,int unit_mode)
@@ -1305,7 +1305,7 @@ int pretty_size_snprintf(u64 size, char *str, size_t str_size, int unit_mode)int num_divs;float fraction;int base =0 ; -const char const **suffix =NULL ; +const char ** suffix =NULL ;u64 last_size;if (str_size ==0 )
Signature · 6 lines
2.0.0.526.g5318336 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-
PATCH 2/2 Remove a leading '+'.
It was added in commit aab7f3ae3eb02fb7e8a6a31d7e2ada704a3dcd5e, most likely as a copy-pasteo.
--- btrfs-show-super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
btrfs-show-super.c +1 -1
@@ -50,7 +50,7 @@ static void print_usage(void)fprintf (stderr,"\t-f : print full superblock information\n" );fprintf (stderr,"\t-a : print information of all superblocks\n" );fprintf (stderr,"\t-i <super_mirror> : specify which mirror to print out\n" ); -+fprintf (stderr,"\t-F : attempt to dump superblocks with bad magic\n" ); +fprintf (stderr,"\t-F : attempt to dump superblocks with bad magic\n" );fprintf (stderr,"%s\n" ,BTRFS_BUILD_VERSION ); }
Signature · 6 lines
2.0.0.526.g5318336 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-
Re: [PATCH 2/2] Remove a leading '+'.
Quoted 14 lines · Adam Buchbinder
It was added in commit
aab7f3ae3eb02fb7e8a6a31d7e2ada704a3dcd5e, most likely as a copy-pasteo.Signed-off-by Adam Buchbinder <[email protected]>--- btrfs-show-super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)btrfs-show-super.c +0
-0
btrfs-show-super.c static void print_usage(void) · line 56
Quoted 8 lines
btrfs-show-super.c +1
-1@@ -50,7 +50,7 @@ static void print_usage(void)fprintf (stderr,"\t-f : print full superblock information\n" );fprintf (stderr,"\t-a : print information of all superblocks\n" );fprintf (stderr,"\t-i <super_mirror> : specify which mirror to print out\n" ); -+fprintf (stderr,"\t-F : attempt to dump superblocks with bad magic\n" ); +fprintf (stderr,"\t-F : attempt to dump superblocks with bad magic\n" );fprintf (stderr,"%s\n" ,BTRFS_BUILD_VERSION ); }
Whoa, git blame blames me, but that's not the patch I sent. ;)
thanks,
-Eric
Re: [PATCH 2/2] Remove a leading '+'.
Quoted 3 lines · Eric Sandeen
btrfs-show-super.c static void print_usage(void) · line 53
Quoted 2 lines
-+
fprintf(stderr, "\t-F : attempt to dump superblocks with bad magic\n");btrfs-show-super.c +1
-0+fprintf (stderr,"\t-F : attempt to dump superblocks with bad magic\n" );Whoa, git blame blames me, but that's not the patch I sent. ;)
My mistak while merging two conflicting show-super patches, sorry.