From patchwork Fri Dec 1 23:25:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 10088281 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C79EF6035E for ; Fri, 1 Dec 2017 23:33:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B674B2A7C7 for ; Fri, 1 Dec 2017 23:33:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A9CD12A817; Fri, 1 Dec 2017 23:33:22 +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=-1.9 required=2.0 tests=BAYES_00, 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 6A6E12A7C7 for ; Fri, 1 Dec 2017 23:33:22 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 641BC21A04E2F; Fri, 1 Dec 2017 15:28:55 -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=134.134.136.100; helo=mga07.intel.com; envelope-from=dan.j.williams@intel.com; receiver=linux-nvdimm@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 AF13C21A10961 for ; Fri, 1 Dec 2017 15:28:54 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Dec 2017 15:33:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,347,1508828400"; d="scan'208";a="12066050" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by orsmga001.jf.intel.com with ESMTP; 01 Dec 2017 15:33:21 -0800 Subject: [ndctl PATCH 07/17] ndctl, smart: cleanup smart_cmd_op() macro From: Dan Williams To: linux-nvdimm@lists.01.org Date: Fri, 01 Dec 2017 15:25:07 -0800 Message-ID: <151217070734.28402.7251875689073860382.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <151217066885.28402.7962437173336388439.stgit@dwillia2-desk3.amr.corp.intel.com> References: <151217066885.28402.7962437173336388439.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.17.1-9-g687f MIME-Version: 1.0 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP Remove the redundant information passed to the smart_cmd_op macro. Signed-off-by: Dan Williams --- ndctl/lib/smart.c | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/ndctl/lib/smart.c b/ndctl/lib/smart.c index 3eeb70e0d2b1..90c45a1a002e 100644 --- a/ndctl/lib/smart.c +++ b/ndctl/lib/smart.c @@ -40,8 +40,8 @@ NDCTL_EXPORT struct ndctl_cmd *ndctl_dimm_cmd_new_smart_threshold( return NULL; } -#define smart_cmd_op(name, op, rettype, defretvalue) \ -NDCTL_EXPORT rettype name(struct ndctl_cmd *cmd) \ +#define smart_cmd_op(op, rettype, defretvalue) \ +NDCTL_EXPORT rettype ndctl_cmd_##op(struct ndctl_cmd *cmd) \ { \ if (cmd->dimm) { \ struct ndctl_smart_ops *ops = ndctl_dimm_get_smart_ops(cmd->dimm); \ @@ -51,21 +51,19 @@ NDCTL_EXPORT rettype name(struct ndctl_cmd *cmd) \ return defretvalue; \ } -smart_cmd_op(ndctl_cmd_smart_get_flags, smart_get_flags, unsigned int, 0) -smart_cmd_op(ndctl_cmd_smart_get_health, smart_get_health, unsigned int, 0) -smart_cmd_op(ndctl_cmd_smart_get_media_temperature, smart_get_media_temperature, - unsigned int, 0) -smart_cmd_op(ndctl_cmd_smart_get_spares, smart_get_spares, unsigned int, 0) -smart_cmd_op(ndctl_cmd_smart_get_alarm_flags, smart_get_alarm_flags, unsigned int, 0) -smart_cmd_op(ndctl_cmd_smart_get_life_used, smart_get_life_used, unsigned int, 0) -smart_cmd_op(ndctl_cmd_smart_get_shutdown_state, smart_get_shutdown_state, unsigned int, 0) -smart_cmd_op(ndctl_cmd_smart_get_shutdown_count, smart_get_shutdown_count, unsigned int, 0) -smart_cmd_op(ndctl_cmd_smart_get_vendor_size, smart_get_vendor_size, unsigned int, 0) -smart_cmd_op(ndctl_cmd_smart_get_vendor_data, smart_get_vendor_data, unsigned char *, NULL) -smart_cmd_op(ndctl_cmd_smart_threshold_get_alarm_control, smart_threshold_get_alarm_control, unsigned int, 0) -smart_cmd_op(ndctl_cmd_smart_threshold_get_media_temperature, - smart_threshold_get_media_temperature, unsigned int, 0) -smart_cmd_op(ndctl_cmd_smart_threshold_get_spares, smart_threshold_get_spares, unsigned int, 0) +smart_cmd_op(smart_get_flags, unsigned int, 0) +smart_cmd_op(smart_get_health, unsigned int, 0) +smart_cmd_op(smart_get_media_temperature, unsigned int, 0) +smart_cmd_op(smart_get_spares, unsigned int, 0) +smart_cmd_op(smart_get_alarm_flags, unsigned int, 0) +smart_cmd_op(smart_get_life_used, unsigned int, 0) +smart_cmd_op(smart_get_shutdown_state, unsigned int, 0) +smart_cmd_op(smart_get_shutdown_count, unsigned int, 0) +smart_cmd_op(smart_get_vendor_size, unsigned int, 0) +smart_cmd_op(smart_get_vendor_data, unsigned char *, NULL) +smart_cmd_op(smart_threshold_get_alarm_control, unsigned int, 0) +smart_cmd_op(smart_threshold_get_media_temperature, unsigned int, 0) +smart_cmd_op(smart_threshold_get_spares, unsigned int, 0) NDCTL_EXPORT unsigned int ndctl_cmd_smart_get_temperature(struct ndctl_cmd *cmd) {