From patchwork Mon Mar 11 10:20:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 10847221 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9DC2A1390 for ; Mon, 11 Mar 2019 10:21:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A9F029037 for ; Mon, 11 Mar 2019 10:21:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 87D2E2903D; Mon, 11 Mar 2019 10:21:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 33D4B29037 for ; Mon, 11 Mar 2019 10:21:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727085AbfCKKU7 (ORCPT ); Mon, 11 Mar 2019 06:20:59 -0400 Received: from mx2.suse.de ([195.135.220.15]:37448 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726826AbfCKKU7 (ORCPT ); Mon, 11 Mar 2019 06:20:59 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id A1CCBAED4 for ; Mon, 11 Mar 2019 10:20:58 +0000 (UTC) From: Nikolay Borisov To: linux-btrfs@vger.kernel.org Cc: Nikolay Borisov Subject: [PATCH] btrfs-progs: Remove get_argv0_buf Date: Mon, 11 Mar 2019 12:20:56 +0200 Message-Id: <20190311102056.27503-1-nborisov@suse.com> X-Mailer: git-send-email 2.17.1 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- help.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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++) {