From patchwork Wed Sep 9 23:01:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 7149691 Return-Path: X-Original-To: patchwork-linux-nvdimm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2FFCE9F32B for ; Wed, 9 Sep 2015 23:07:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4840E20863 for ; Wed, 9 Sep 2015 23:07:10 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 5DEDF20813 for ; Wed, 9 Sep 2015 23:07:09 +0000 (UTC) Received: from ml01.vlan14.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 4836A182E5C; Wed, 9 Sep 2015 16:07:09 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by ml01.01.org (Postfix) with ESMTP id 09EAD182E58 for ; Wed, 9 Sep 2015 16:07:09 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 09 Sep 2015 16:07:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,499,1437462000"; d="scan'208";a="801851810" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.137]) by fmsmga002.fm.intel.com with ESMTP; 09 Sep 2015 16:07:08 -0700 Subject: [PATCH v2 1/4] ndctl: update dimm flag names From: Dan Williams To: linux-nvdimm@lists.01.org Date: Wed, 09 Sep 2015 19:01:26 -0400 Message-ID: <20150909230126.4976.59652.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <20150909224404.4976.10592.stgit@dwillia2-desk3.amr.corp.intel.com> References: <20150909224404.4976.10592.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.17.1-8-g92dd MIME-Version: 1.0 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.17 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-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It is important for the flag names to be explicit about their polarity as feedback to a firmware implementer to get the polarity correct. Update to keep in sync with the kernel rename. Cc: Robert Elliott Cc: Linda Knippers Cc: Toshi Kani [toshi: fix up flag prints in check_dimms() as well] Signed-off-by: Dan Williams Reviewed-by: Toshi Kani --- lib/libndctl.c | 10 +++++----- lib/test-libndctl.c | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/libndctl.c b/lib/libndctl.c index d08cf0812f50..d85453a3ac63 100644 --- a/lib/libndctl.c +++ b/lib/libndctl.c @@ -839,15 +839,15 @@ static void parse_nfit_mem_flags(struct ndctl_dimm *dimm, char *flags) start = flags; while ((end = strchr(start, ' '))) { *end = '\0'; - if (strcmp(start, "arm") == 0) + if (strcmp(start, "not_armed") == 0) dimm->f_arm = 1; - else if (strcmp(start, "save") == 0) + else if (strcmp(start, "save_fail") == 0) dimm->f_save = 1; - else if (strcmp(start, "flush") == 0) + else if (strcmp(start, "flush_fail") == 0) dimm->f_flush = 1; - else if (strcmp(start, "smart") == 0) + else if (strcmp(start, "smart_event") == 0) dimm->f_smart = 1; - else if (strcmp(start, "restore") == 0) + else if (strcmp(start, "restore_fail") == 0) dimm->f_restore = 1; start = end + 1; } diff --git a/lib/test-libndctl.c b/lib/test-libndctl.c index c2e7bc7b4ff4..d70fb3734d1f 100644 --- a/lib/test-libndctl.c +++ b/lib/test-libndctl.c @@ -1471,8 +1471,8 @@ static int check_dimms(struct ndctl_bus *bus, struct dimm *dimms, int n, if (ndctl_dimm_has_errors(dimm) != !!dimms[i].flags) { fprintf(stderr, "bus: %s dimm%d %s expected%s errors\n", ndctl_bus_get_provider(bus), i, - dimms[i].flags ? "" : " no", - ndctl_dimm_get_devname(dimm)); + ndctl_dimm_get_devname(dimm), + dimms[i].flags ? "" : " no"); return -ENXIO; } @@ -1482,16 +1482,16 @@ static int check_dimms(struct ndctl_bus *bus, struct dimm *dimms, int n, || ndctl_dimm_smart_pending(dimm) != dimms[i].f_smart || ndctl_dimm_failed_flush(dimm) != dimms[i].f_flush) { fprintf(stderr, "expected: %s%s%s%s%sgot: %s%s%s%s%s\n", - dimms[i].f_save ? "save " : "", - dimms[i].f_arm ? "arm " : "", - dimms[i].f_restore ? "restore " : "", - dimms[i].f_smart ? "smart " : "", - dimms[i].f_flush ? "flush " : "", - ndctl_dimm_failed_save(dimm) ? "save " : "", - ndctl_dimm_failed_arm(dimm) ? "arm " : "", - ndctl_dimm_failed_restore(dimm) ? "restore " : "", - ndctl_dimm_smart_pending(dimm) ? "smart " : "", - ndctl_dimm_failed_flush(dimm) ? "flush " : ""); + dimms[i].f_save ? "save_fail " : "", + dimms[i].f_arm ? "arm_fail " : "", + dimms[i].f_restore ? "restore_fail " : "", + dimms[i].f_smart ? "smart_event " : "", + dimms[i].f_flush ? "flush_fail " : "", + ndctl_dimm_failed_save(dimm) ? "save_fail " : "", + ndctl_dimm_failed_arm(dimm) ? "arm_fail " : "", + ndctl_dimm_failed_restore(dimm) ? "restore_fail " : "", + ndctl_dimm_smart_pending(dimm) ? "smart_event " : "", + ndctl_dimm_failed_flush(dimm) ? "flush_fail " : ""); return -ENXIO; }