diff mbox series

btrfs-progs: Remove get_argv0_buf

Message ID 20190311102056.27503-1-nborisov@suse.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: Remove get_argv0_buf | expand

Commit Message

Nikolay Borisov March 11, 2019, 10:20 a.m. UTC
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 <nborisov@suse.com>
---
 help.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

Comments

David Sterba March 11, 2019, 2:30 p.m. UTC | #1
On Mon, Mar 11, 2019 at 12:20:56PM +0200, Nikolay Borisov wrote:
> 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 <nborisov@suse.com>

Applied, thanks.
diff mbox series

Patch

diff --git a/help.c b/help.c
index b10b2b053e13..09e771ef6695 100644
--- a/help.c
+++ b/help.c
@@ -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++) {