btrfs-progs: Remove get_argv0_buf
PATCH 1/1 btrfs-progs: Remove get_argv0_buf
get_argv0_buf is used only in two functions in help.c which also has direct access to the static argv0_buf. All other references to this buffer are direct. So remove the function. No functional changes.
Signed-off-by Nikolay Borisov <[email protected]>
--- help.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
help.c +2 -7
@@ -31,11 +31,6 @@static char argv0_buf[ARGV0_BUF_SIZE ] ="btrfs" ; -const char *get_argv0_buf (void ) -{ -return argv0_buf; -} -void fixup_argv0 (char **argv,const char *token) {int len =strlen (argv0_buf);
@@ -349,7 +344,7 @@ void usage_command_group(const struct cmd_group *grp, int full, int err) __attribute__((noreturn))void help_unknown_token (const char *arg,const struct cmd_group *grp) { -fprintf (stderr,"%s: unknown token '%s'\n" ,get_argv0_buf (), arg); +fprintf (stderr,"%s: unknown token '%s'\n" , argv0_buf, arg);usage_command_group (grp,0 ,1 );exit (1 ); }
@@ -359,7 +354,7 @@ void help_ambiguous_token(const char *arg, const struct cmd_group *grp) {const struct cmd_struct *cmd = grp->commands; -fprintf (stderr,"%s: ambiguous token '%s'\n" ,get_argv0_buf (), arg); +fprintf (stderr,"%s: ambiguous token '%s'\n" , argv0_buf, arg);fprintf (stderr,"\nDid you mean one of these ?\n" );for (; cmd->token; cmd++) {
Signature · 1 line
2.7.4
David Sterba
AppliedQuoted 5 lines · Nikolay Borisov
get_argv0_bufis used only in two functions inhelp.cwhich also has direct access to the staticargv0_buf. All other references to this buffer are direct. So remove the function. No functional changes.Signed-off-by Nikolay Borisov <[email protected]>
Applied, thanks.