All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>,
	Dan Williams <dan.j.williams@intel.com>
Cc: Matthew Wilcox <willy@linux.intel.com>,
	linux-fsdevel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] dax: silence an uninitialized variable warning
Date: Tue, 22 Mar 2016 14:38:49 +0300	[thread overview]
Message-ID: <20160322113848.GA4519@mwanda> (raw)

I'm not positive, but it looks like it might be possible to reach the
end of this function and return an uninitialized value for "rc".  Anyway
it causes a static checker warning and let's silence it.

The warning was introduced in commit b2e0d1625e19 ('dax: fix lifetime of
in-kernel dax mappings with dax_map_atomic()').

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/fs/dax.c b/fs/dax.c
index 90322eb..3744e14 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -155,7 +155,8 @@ static ssize_t dax_io(struct inode *inode, struct iov_iter *iter,
 	loff_t pos = start, max = start, bh_max = start;
 	bool hole = false, need_wmb = false;
 	struct block_device *bdev = NULL;
-	int rw = iov_iter_rw(iter), rc;
+	int rc = 0;
+	int rw = iov_iter_rw(iter);
 	long map_len = 0;
 	struct blk_dax_ctl dax = {
 		.addr = (void __pmem *) ERR_PTR(-EIO),

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>,
	Dan Williams <dan.j.williams@intel.com>
Cc: Matthew Wilcox <willy@linux.intel.com>,
	linux-fsdevel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] dax: silence an uninitialized variable warning
Date: Tue, 22 Mar 2016 11:38:49 +0000	[thread overview]
Message-ID: <20160322113848.GA4519@mwanda> (raw)

I'm not positive, but it looks like it might be possible to reach the
end of this function and return an uninitialized value for "rc".  Anyway
it causes a static checker warning and let's silence it.

The warning was introduced in commit b2e0d1625e19 ('dax: fix lifetime of
in-kernel dax mappings with dax_map_atomic()').

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/fs/dax.c b/fs/dax.c
index 90322eb..3744e14 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -155,7 +155,8 @@ static ssize_t dax_io(struct inode *inode, struct iov_iter *iter,
 	loff_t pos = start, max = start, bh_max = start;
 	bool hole = false, need_wmb = false;
 	struct block_device *bdev = NULL;
-	int rw = iov_iter_rw(iter), rc;
+	int rc = 0;
+	int rw = iov_iter_rw(iter);
 	long map_len = 0;
 	struct blk_dax_ctl dax = {
 		.addr = (void __pmem *) ERR_PTR(-EIO),

             reply	other threads:[~2016-03-22 11:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-22 11:38 Dan Carpenter [this message]
2016-03-22 11:38 ` [patch] dax: silence an uninitialized variable warning Dan Carpenter
2016-03-22 17:26 ` Jeff Moyer
2016-03-22 17:26   ` Jeff Moyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160322113848.GA4519@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=dan.j.williams@intel.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.