mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: pramod.gurav.etc@gmail.com
To: unlisted-recipients:; (no To-header on input)
Cc: Pramod Gurav <pramod.gurav.etc@gmail.com>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] fs/direct-io.c: Fix compilation warning for uninitialized variables
Date: Fri,  4 Jul 2014 11:13:52 +0530	[thread overview]
Message-ID: <1404452632-10912-1-git-send-email-pramod.gurav.etc@gmail.com> (raw)

From: Pramod Gurav <pramod.gurav.etc@gmail.com>

Fixes below warning while compiling the kernel.

fs/direct-io.c: In function ‘__blockdev_direct_IO’:
fs/direct-io.c:1011:12: warning: ‘to’ may be used uninitialized in this function [-Wmaybe-uninitialized]
fs/direct-io.c:913:16: note: ‘to’ was declared here
fs/direct-io.c:1011:12: warning: ‘from’ may be used uninitialized in this function [-Wmaybe-uninitialized]
fs/direct-io.c:913:10: note: ‘from’ was declared here

Signed-off-by: Pramod Gurav <pramod.gurav.etc@gmail.com>

CC: Alexander Viro <viro@zeniv.linux.org.uk>
CC: linux-fsdevel@vger.kernel.org
CC: linux-kernel@vger.kernel.org
---
 fs/direct-io.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/direct-io.c b/fs/direct-io.c
index 98040ba..6ad5d2c 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -910,7 +910,7 @@ static int do_direct_IO(struct dio *dio, struct dio_submit *sdio,
 
 	while (sdio->block_in_file < sdio->final_block_in_request) {
 		struct page *page;
-		size_t from, to;
+		size_t from = 0, to = 0;
 		page = dio_get_page(dio, sdio, &from, &to);
 		if (IS_ERR(page)) {
 			ret = PTR_ERR(page);
-- 
1.7.9.5


             reply	other threads:[~2014-07-04  5:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-04  5:43 pramod.gurav.etc [this message]
2014-07-13 11:50 ` Christoph Hellwig
2014-07-14  7:04   ` pramod gurav
2014-07-16 17:08   ` Boaz Harrosh
2014-07-16 17:56     ` Jason Cooper
2014-07-16 17:58     ` Christoph Hellwig
2014-07-16 18:42       ` Paul Bolle
2014-07-17  9:37         ` direct-io: squelch maybe-uninitialized warning in do_direct_IO() Boaz Harrosh
2014-07-17  9:40           ` Boaz Harrosh
2014-07-17  9:54             ` Paul Bolle
2014-07-17  9:48           ` Paul Bolle
2014-07-17 11:00             ` Boaz Harrosh
2014-07-17 11:11           ` [PATCH v2] " Boaz Harrosh
2014-07-17 11:29             ` Paul Bolle
2014-07-20  9:09               ` [PATCH v3] direct-io: fix uninitialized " Boaz Harrosh
2014-07-21 11:36                 ` Christoph Hellwig
2014-07-22  9:03                   ` Boaz Harrosh

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=1404452632-10912-1-git-send-email-pramod.gurav.etc@gmail.com \
    --to=pramod.gurav.etc@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®