From patchwork Thu Jan 31 23:25:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Jiang X-Patchwork-Id: 10791573 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 AF6E9746 for ; Thu, 31 Jan 2019 23:25:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A62E0315B8 for ; Thu, 31 Jan 2019 23:25:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A8C63162D; Thu, 31 Jan 2019 23:25:13 +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=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2F488315B8 for ; Thu, 31 Jan 2019 23:25:13 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 26343211C3F6D; Thu, 31 Jan 2019 15:25:13 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.151; helo=mga17.intel.com; envelope-from=dave.jiang@intel.com; receiver=linux-nvdimm@lists.01.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 28C86211C3F5C for ; Thu, 31 Jan 2019 15:25:11 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jan 2019 15:25:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,546,1539673200"; d="scan'208";a="139670163" Received: from djiang5-desk3.ch.intel.com ([143.182.136.93]) by fmsmga002.fm.intel.com with ESMTP; 31 Jan 2019 15:25:10 -0800 Subject: [PATCH] ndctl: make command be the same as function names for security functions From: Dave Jiang To: vishal.l.verma@intel.com Date: Thu, 31 Jan 2019 16:25:10 -0700 Message-ID: <154897711044.51306.8448938775272102034.stgit@djiang5-desk3.ch.intel.com> User-Agent: StGit/unknown-version MIME-Version: 1.0 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-nvdimm@lists.01.org Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP Fix a few inconsistencies in the ndctl command name versus the function name. Signed-off-by: Dave Jiang --- ndctl/builtin.h | 6 +++--- ndctl/dimm.c | 18 +++++++++--------- ndctl/ndctl.c | 6 +++--- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ndctl/builtin.h b/ndctl/builtin.h index 60c3623f..681a69ff 100644 --- a/ndctl/builtin.h +++ b/ndctl/builtin.h @@ -32,9 +32,9 @@ int cmd_bat(int argc, const char **argv, struct ndctl_ctx *ctx); #endif int cmd_update_firmware(int argc, const char **argv, struct ndctl_ctx *ctx); int cmd_inject_smart(int argc, const char **argv, struct ndctl_ctx *ctx); -int cmd_passphrase_setup(int argc, const char **argv, struct ndctl_ctx *ctx); -int cmd_passphrase_update(int argc, const char **argv, struct ndctl_ctx *ctx); -int cmd_passphrase_remove(int argc, const char **argv, struct ndctl_ctx *ctx); +int cmd_setup_passphrase(int argc, const char **argv, struct ndctl_ctx *ctx); +int cmd_update_passphrase(int argc, const char **argv, struct ndctl_ctx *ctx); +int cmd_remove_passphrase(int argc, const char **argv, struct ndctl_ctx *ctx); int cmd_freeze_security(int argc, const char **argv, struct ndctl_ctx *ctx); int cmd_sanitize_dimm(int argc, const char **argv, struct ndctl_ctx *ctx); int cmd_load_keys(int argc, const char **argv, struct ndctl_ctx *ctx); diff --git a/ndctl/dimm.c b/ndctl/dimm.c index d4e2090f..35e3190e 100644 --- a/ndctl/dimm.c +++ b/ndctl/dimm.c @@ -841,7 +841,7 @@ static int action_update(struct ndctl_dimm *dimm, struct action_context *actx) return rc; } -static int action_passphrase_setup(struct ndctl_dimm *dimm, +static int action_setup_passphrase(struct ndctl_dimm *dimm, struct action_context *actx) { if (ndctl_dimm_get_security(dimm) < 0) { @@ -857,7 +857,7 @@ static int action_passphrase_setup(struct ndctl_dimm *dimm, param.master_pass ? ND_MASTER_KEY : ND_USER_KEY); } -static int action_passphrase_update(struct ndctl_dimm *dimm, +static int action_update_passphrase(struct ndctl_dimm *dimm, struct action_context *actx) { if (ndctl_dimm_get_security(dimm) < 0) { @@ -870,7 +870,7 @@ static int action_passphrase_update(struct ndctl_dimm *dimm, param.master_pass ? ND_MASTER_KEY : ND_USER_KEY); } -static int action_passphrase_remove(struct ndctl_dimm *dimm, +static int action_remove_passphrase(struct ndctl_dimm *dimm, struct action_context *actx) { if (ndctl_dimm_get_security(dimm) < 0) { @@ -1335,9 +1335,9 @@ int cmd_update_firmware(int argc, const char **argv, struct ndctl_ctx *ctx) return count >= 0 ? 0 : EXIT_FAILURE; } -int cmd_passphrase_update(int argc, const char **argv, struct ndctl_ctx *ctx) +int cmd_update_passphrase(int argc, const char **argv, struct ndctl_ctx *ctx) { - int count = dimm_action(argc, argv, ctx, action_passphrase_update, + int count = dimm_action(argc, argv, ctx, action_update_passphrase, key_options, "ndctl update-passphrase [..] []"); @@ -1346,9 +1346,9 @@ int cmd_passphrase_update(int argc, const char **argv, struct ndctl_ctx *ctx) return count >= 0 ? 0 : EXIT_FAILURE; } -int cmd_passphrase_setup(int argc, const char **argv, struct ndctl_ctx *ctx) +int cmd_setup_passphrase(int argc, const char **argv, struct ndctl_ctx *ctx) { - int count = dimm_action(argc, argv, ctx, action_passphrase_setup, + int count = dimm_action(argc, argv, ctx, action_setup_passphrase, key_options, "ndctl setup-passphrase [..] []"); @@ -1357,9 +1357,9 @@ int cmd_passphrase_setup(int argc, const char **argv, struct ndctl_ctx *ctx) return count >= 0 ? 0 : EXIT_FAILURE; } -int cmd_passphrase_remove(int argc, const char **argv, void *ctx) +int cmd_remove_passphrase(int argc, const char **argv, void *ctx) { - int count = dimm_action(argc, argv, ctx, action_passphrase_remove, + int count = dimm_action(argc, argv, ctx, action_remove_passphrase, base_options, "ndctl remove-passphrase [..] []"); diff --git a/ndctl/ndctl.c b/ndctl/ndctl.c index 04bf56d6..b5c3bf88 100644 --- a/ndctl/ndctl.c +++ b/ndctl/ndctl.c @@ -88,9 +88,9 @@ static struct cmd_struct commands[] = { { "inject-smart", { cmd_inject_smart } }, { "wait-scrub", { cmd_wait_scrub } }, { "start-scrub", { cmd_start_scrub } }, - { "setup-passphrase", { cmd_passphrase_setup } }, - { "update-passphrase", { cmd_passphrase_update } }, - { "remove-passphrase", { cmd_passphrase_remove } }, + { "setup-passphrase", { cmd_setup_passphrase } }, + { "update-passphrase", { cmd_update_passphrase } }, + { "remove-passphrase", { cmd_remove_passphrase } }, { "freeze-security", { cmd_freeze_security } }, { "sanitize-dimm", { cmd_sanitize_dimm } }, { "load-keys", { cmd_load_keys } },