From patchwork Fri Oct 18 20:22:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Moyer X-Patchwork-Id: 11199563 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6F12919A1 for ; Fri, 18 Oct 2019 20:23:16 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 57972222C2 for ; Fri, 18 Oct 2019 20:23:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 57972222C2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from new-ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 5879B10FCB90A; Fri, 18 Oct 2019 13:25:19 -0700 (PDT) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=jmoyer@redhat.com; receiver= Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 9DAA610FCB903 for ; Fri, 18 Oct 2019 13:25:14 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E1F3430833CB for ; Fri, 18 Oct 2019 20:23:08 +0000 (UTC) Received: from segfault.boston.devel.redhat.com (segfault.boston.devel.redhat.com [10.19.60.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C5C2D600C1; Fri, 18 Oct 2019 20:23:08 +0000 (UTC) Received: by segfault.boston.devel.redhat.com (Postfix, from userid 3734) id C6BDA21C9AD0; Fri, 18 Oct 2019 16:23:07 -0400 (EDT) From: Jeff Moyer To: linux-nvdimm@lists.01.org Cc: Jeff Moyer Subject: [ndctl patch 1/4] util/abspath: cleanup prefix_filename Date: Fri, 18 Oct 2019 16:22:59 -0400 Message-Id: <20191018202302.8122-2-jmoyer@redhat.com> In-Reply-To: <20191018202302.8122-1-jmoyer@redhat.com> References: <20191018202302.8122-1-jmoyer@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Fri, 18 Oct 2019 20:23:08 +0000 (UTC) Message-ID-Hash: N46UR2VWPVFJEYZ6UUJU3ECP672X6XBN X-Message-ID-Hash: N46UR2VWPVFJEYZ6UUJU3ECP672X6XBN X-MailFrom: jmoyer@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Static checkers complain about the unused assignment to pfx_len. The code can obviously be simplified. Signed-off-by: Jeff Moyer Reviewed-by: Ira Weiny --- util/abspath.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/util/abspath.c b/util/abspath.c index 09bbd27..e44236f 100644 --- a/util/abspath.c +++ b/util/abspath.c @@ -9,11 +9,7 @@ char *prefix_filename(const char *pfx, const char *arg) struct strbuf path = STRBUF_INIT; size_t pfx_len = pfx ? strlen(pfx) : 0; - if (!pfx_len) - ; - else if (is_absolute_path(arg)) - pfx_len = 0; - else + if (pfx_len && !is_absolute_path(arg)) strbuf_add(&path, pfx, pfx_len); strbuf_addstr(&path, arg); From patchwork Fri Oct 18 20:23:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Moyer X-Patchwork-Id: 11199559 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7794819A1 for ; Fri, 18 Oct 2019 20:23:13 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5F901222C5 for ; Fri, 18 Oct 2019 20:23:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F901222C5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from new-ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3599E10FCB905; Fri, 18 Oct 2019 13:25:18 -0700 (PDT) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=jmoyer@redhat.com; receiver= Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 9B6F310FCB900 for ; Fri, 18 Oct 2019 13:25:14 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E279610F2E82 for ; Fri, 18 Oct 2019 20:23:08 +0000 (UTC) Received: from segfault.boston.devel.redhat.com (segfault.boston.devel.redhat.com [10.19.60.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C561560603; Fri, 18 Oct 2019 20:23:08 +0000 (UTC) Received: by segfault.boston.devel.redhat.com (Postfix, from userid 3734) id C986A21C9AD3; Fri, 18 Oct 2019 16:23:07 -0400 (EDT) From: Jeff Moyer To: linux-nvdimm@lists.01.org Cc: Jeff Moyer Subject: [ndctl patch 2/4] fix building of tags tables Date: Fri, 18 Oct 2019 16:23:00 -0400 Message-Id: <20191018202302.8122-3-jmoyer@redhat.com> In-Reply-To: <20191018202302.8122-1-jmoyer@redhat.com> References: <20191018202302.8122-1-jmoyer@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Fri, 18 Oct 2019 20:23:08 +0000 (UTC) Message-ID-Hash: 6C6OVD45F2YARMTWHKD5ERAQSC53QK2I X-Message-ID-Hash: 6C6OVD45F2YARMTWHKD5ERAQSC53QK2I X-MailFrom: jmoyer@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Make currently fails with: make[1]: *** No rule to make target 'libndctl.h', needed by 'tags-am'. Stop. The path to libndctl.h is wrong in ndctl/lib/Makefile.am. Fix it. Signed-off-by: Jeff Moyer Reviewed-by: Ira Weiny --- ndctl/lib/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndctl/lib/Makefile.am b/ndctl/lib/Makefile.am index fb75fda..e4eb006 100644 --- a/ndctl/lib/Makefile.am +++ b/ndctl/lib/Makefile.am @@ -7,7 +7,7 @@ pkginclude_HEADERS = ../libndctl.h ../ndctl.h lib_LTLIBRARIES = libndctl.la libndctl_la_SOURCES =\ - libndctl.h \ + ../libndctl.h \ private.h \ ../../util/log.c \ ../../util/log.h \ From patchwork Fri Oct 18 20:23:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Moyer X-Patchwork-Id: 11199565 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BC9FB14ED for ; Fri, 18 Oct 2019 20:23:17 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A4ADB222C2 for ; Fri, 18 Oct 2019 20:23:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A4ADB222C2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from new-ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 6C32810FCB910; Fri, 18 Oct 2019 13:25:19 -0700 (PDT) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=jmoyer@redhat.com; receiver= Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 9C32910FCB901 for ; Fri, 18 Oct 2019 13:25:14 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E131818B20E6 for ; Fri, 18 Oct 2019 20:23:08 +0000 (UTC) Received: from segfault.boston.devel.redhat.com (segfault.boston.devel.redhat.com [10.19.60.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C516B7E2A; Fri, 18 Oct 2019 20:23:08 +0000 (UTC) Received: by segfault.boston.devel.redhat.com (Postfix, from userid 3734) id D1CC521C9AD5; Fri, 18 Oct 2019 16:23:07 -0400 (EDT) From: Jeff Moyer To: linux-nvdimm@lists.01.org Cc: Jeff Moyer Subject: [ndctl patch 4/4] load-keys: get rid of duplicate assignment Date: Fri, 18 Oct 2019 16:23:02 -0400 Message-Id: <20191018202302.8122-5-jmoyer@redhat.com> In-Reply-To: <20191018202302.8122-1-jmoyer@redhat.com> References: <20191018202302.8122-1-jmoyer@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.70]); Fri, 18 Oct 2019 20:23:08 +0000 (UTC) Message-ID-Hash: EK2EH7W7AIFPU2F6EIN77VK6XVQF7VTZ X-Message-ID-Hash: EK2EH7W7AIFPU2F6EIN77VK6XVQF7VTZ X-MailFrom: jmoyer@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Signed-off-by: Jeff Moyer Reviewed-by: Ira Weiny --- ndctl/load-keys.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ndctl/load-keys.c b/ndctl/load-keys.c index 981f80f..f0b7a5a 100644 --- a/ndctl/load-keys.c +++ b/ndctl/load-keys.c @@ -185,7 +185,6 @@ static int load_keys(struct loadkeys *lk_ctx, const char *keypath, rc = chdir(keypath); if (rc < 0) { - rc = -errno; fprintf(stderr, "Change current work dir to %s failed: %s\n", param.key_path, strerror(errno)); rc = -errno;