From patchwork Mon Apr 25 19:50:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 8931891 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 706579F1C1 for ; Mon, 25 Apr 2016 19:50:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A45F32011E for ; Mon, 25 Apr 2016 19:50:56 +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 B573B2015A for ; Mon, 25 Apr 2016 19:50:55 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9608A1A1ED4; Mon, 25 Apr 2016 12:50:55 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by ml01.01.org (Postfix) with ESMTP id 25B411A1ED4 for ; Mon, 25 Apr 2016 12:50:54 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 25 Apr 2016 12:50:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,534,1455004800"; d="scan'208";a="966241056" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.14]) by fmsmga002.fm.intel.com with ESMTP; 25 Apr 2016 12:50:53 -0700 Subject: [ndctl PATCH 3/7] ndctl: fix some warnings From: Dan Williams To: linux-nvdimm@lists.01.org Date: Mon, 25 Apr 2016 12:50:05 -0700 Message-ID: <146161380523.21779.1858997961702829201.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <146161378966.21779.1219526957524644729.stgit@dwillia2-desk3.amr.corp.intel.com> References: <146161378966.21779.1219526957524644729.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.20 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, 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 builtin-read-labels.c:417:5: warning: 'count' may be used uninitialized in this function builtin-xaction-namespace.c:526:2: warning: 'buf' may be used uninitialized in this function Signed-off-by: Dan Williams --- builtin-read-labels.c | 3 +-- builtin-xaction-namespace.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/builtin-read-labels.c b/builtin-read-labels.c index bea20184c7f8..9dd90c92304e 100644 --- a/builtin-read-labels.c +++ b/builtin-read-labels.c @@ -336,7 +336,7 @@ int cmd_read_labels(int argc, const char **argv) struct ndctl_dimm *dimm; struct ndctl_ctx *ctx; struct ndctl_bus *bus; - int i, rc, count, err = 0; + int i, rc, count = 0, err = 0; FILE *f_out = NULL; argc = parse_options(argc, argv, nmem_options, u, 0); @@ -377,7 +377,6 @@ int cmd_read_labels(int argc, const char **argv) if (rc < 0) goto out; - count = 0; ndctl_bus_foreach(ctx, bus) { if (!util_bus_filter(bus, nmem_bus)) continue; diff --git a/builtin-xaction-namespace.c b/builtin-xaction-namespace.c index 40f62822facd..d20e9167dc81 100644 --- a/builtin-xaction-namespace.c +++ b/builtin-xaction-namespace.c @@ -490,8 +490,8 @@ static int zero_info_block(struct ndctl_namespace *ndns) { const char *devname = ndctl_namespace_get_devname(ndns); int fd, rc = -ENXIO; + void *buf = NULL; char path[50]; - void *buf; ndctl_namespace_set_raw_mode(ndns, 1); rc = ndctl_namespace_enable(ndns);