From patchwork Fri Jun 15 00:27:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 10465473 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 EACB0600F4 for ; Fri, 15 Jun 2018 00:37:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB26C28A12 for ; Fri, 15 Jun 2018 00:37:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CDDA528C3F; Fri, 15 Jun 2018 00:37:15 +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 8F44628A12 for ; Fri, 15 Jun 2018 00:37:15 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 7AF9021122E38; Thu, 14 Jun 2018 17:37:15 -0700 (PDT) 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.136; helo=mga12.intel.com; envelope-from=dan.j.williams@intel.com; receiver=linux-nvdimm@lists.01.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (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 8A42B21114792 for ; Thu, 14 Jun 2018 17:37:13 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jun 2018 17:37:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,224,1526367600"; d="scan'208";a="208229613" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by orsmga004.jf.intel.com with ESMTP; 14 Jun 2018 17:37:12 -0700 Subject: [ndctl PATCH 2/2] ndctl, test: Update libndctl test for controller temperature valid From: Dan Williams To: linux-nvdimm@lists.01.org Date: Thu, 14 Jun 2018 17:27:15 -0700 Message-ID: <152902243580.9861.7729384829710178825.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <152902243071.9861.114193928672557044.stgit@dwillia2-desk3.amr.corp.intel.com> References: <152902243071.9861.114193928672557044.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.18-2-gc94f MIME-Version: 1.0 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.26 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 nfit_test is growing support for emitting the controller temperature. Permit use of the flag, i.e. do not fail upon seeing 'CTEMP_VALID'. Rather than add a kernel version gate, just be tolerant of any value of the flag. Signed-off-by: Dan Williams --- test/libndctl.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/libndctl.c b/test/libndctl.c index 8098c1c45051..edff0af33c7d 100644 --- a/test/libndctl.c +++ b/test/libndctl.c @@ -2177,8 +2177,8 @@ static int check_set_config_data(struct ndctl_bus *bus, struct ndctl_dimm *dimm, return 0; } -#define __check_smart(dimm, cmd, field) ({ \ - if (ndctl_cmd_smart_get_##field(cmd) != smart_data.field) { \ +#define __check_smart(dimm, cmd, field, mask) ({ \ + if ((ndctl_cmd_smart_get_##field(cmd) & mask) != smart_data.field) { \ fprintf(stderr, "%s dimm: %#x expected \'" #field \ "\' %#x got: %#x\n", __func__, \ ndctl_dimm_get_handle(dimm), \ @@ -2230,14 +2230,14 @@ static int check_smart(struct ndctl_bus *bus, struct ndctl_dimm *dimm, return rc; } - __check_smart(dimm, cmd, flags); - __check_smart(dimm, cmd, health); - __check_smart(dimm, cmd, temperature); - __check_smart(dimm, cmd, spares); - __check_smart(dimm, cmd, alarm_flags); - __check_smart(dimm, cmd, life_used); - __check_smart(dimm, cmd, shutdown_state); - __check_smart(dimm, cmd, vendor_size); + __check_smart(dimm, cmd, flags, ~ND_SMART_CTEMP_VALID); + __check_smart(dimm, cmd, health, -1); + __check_smart(dimm, cmd, temperature, -1); + __check_smart(dimm, cmd, spares, -1); + __check_smart(dimm, cmd, alarm_flags, -1); + __check_smart(dimm, cmd, life_used, -1); + __check_smart(dimm, cmd, shutdown_state, -1); + __check_smart(dimm, cmd, vendor_size, -1); check->cmd = cmd; return 0;