From patchwork Tue Jul 28 03:14:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 6879161 X-Patchwork-Delegate: vishal.l.verma@intel.com Return-Path: X-Original-To: patchwork-linux-nvdimm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D1DF2C05AC for ; Tue, 28 Jul 2015 03:20:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 19493206B6 for ; Tue, 28 Jul 2015 03:20:20 +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 430B3206AC for ; Tue, 28 Jul 2015 03:20:19 +0000 (UTC) Received: from ml01.vlan14.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 33D7C182835; Mon, 27 Jul 2015 20:20:19 -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 244D518280E for ; Mon, 27 Jul 2015 20:20:18 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 27 Jul 2015 20:20:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,560,1432623600"; d="scan'208";a="756264209" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.11]) by fmsmga001.fm.intel.com with ESMTP; 27 Jul 2015 20:20:17 -0700 Subject: [ndctl PATCH 2/3] ndctl: fix uninitialized variable warnings From: Dan Williams To: linux-nvdimm@lists.01.org Date: Mon, 27 Jul 2015 23:14:33 -0400 Message-ID: <20150728031433.19103.56329.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <20150728030655.19103.47017.stgit@dwillia2-desk3.amr.corp.intel.com> References: <20150728030655.19103.47017.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=-3.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, 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 Fix a couple warnings that pop when building with rpmbuild: builtin-zero-labels.c: In function 'cmd_zero_labels': builtin-zero-labels.c:50:20: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized] lib/libndctl.c: In function 'ndctl_bind': lib/libndctl.c:3073:5: warning: 'rc' may be used uninitialized in this function [-Wmaybe-unini Signed-off-by: Dan Williams --- builtin-zero-labels.c | 2 +- lib/libndctl.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin-zero-labels.c b/builtin-zero-labels.c index 0b786d137817..ae2bb3a8fdb0 100644 --- a/builtin-zero-labels.c +++ b/builtin-zero-labels.c @@ -47,7 +47,7 @@ int cmd_zero_labels(int argc, const char **argv) struct ndctl_dimm *dimm; struct ndctl_ctx *ctx; struct ndctl_bus *bus; - int i, rc, count, err; + int i, rc, count, err = 0; argc = parse_options(argc, argv, nmem_options, u, 0); diff --git a/lib/libndctl.c b/lib/libndctl.c index b87c7cf2a7cf..6139af363b48 100644 --- a/lib/libndctl.c +++ b/lib/libndctl.c @@ -3019,8 +3019,8 @@ NDCTL_EXPORT int ndctl_namespace_is_enabled(struct ndctl_namespace *ndns) static int ndctl_bind(struct ndctl_ctx *ctx, struct kmod_module *module, const char *devname) { - int rc; DIR *dir; + int rc = 0; char path[200]; struct dirent *de; const int len = sizeof(path);