linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs/direct-io.c: Fix compilation warning for uninitialized variables
@ 2014-07-04  5:43 pramod.gurav.etc
  2014-07-13 11:50 ` Christoph Hellwig
  0 siblings, 1 reply; 17+ messages in thread
From: pramod.gurav.etc @ 2014-07-04  5:43 UTC (permalink / raw)
  Cc: Pramod Gurav, Alexander Viro, linux-fsdevel, linux-kernel

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

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2014-07-22  9:03 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-04  5:43 [PATCH] fs/direct-io.c: Fix compilation warning for uninitialized variables pramod.gurav.etc
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).