From: Markus Mayer <markus.mayer@linaro.org>
To: Alexander Viro <viro@zeniv.linux.org.uk>,
Jason Cooper <jason@lakedaemon.net>
Cc: Linux Filesystem Mailing List <linux-fsdevel@vger.kernel.org>,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] direct-io: squelch maybe-uninitialized warning in do_direct_IO()
Date: Mon, 23 Jun 2014 12:54:08 -0700 [thread overview]
Message-ID: <1403553248-16536-1-git-send-email-markus.mayer@linaro.org> (raw)
In-Reply-To: <1403323139-12858-1-git-send-email-jason@lakedaemon.net>
I did a bit of digging on this and I am wondering if the initialization
of "to" and "from" to 0 should instead be done in dio_get_page().
The warning is caused by the return in dio_get_page():
ret = dio_refill_pages(dio, sdio);
if (ret)
return ERR_PTR(ret);
This code path would leave "to" and "from" uninitialized (even though the
caller currently never uses the variables in that case).
If both variables are initialized to 0 in dio_get_page(), it would
guarantee that any future callers of dio_get_page() also get to take
advantage of the initialization. If, however, the variables are only
initialized in do_direct_IO(), other callers would have to take care of
this themselves (or the same warnings will pop up there).
There aren't currently any other callers to dio_get_page(), so the
choice is probably not a terribly critical one right now, but I wanted
to at least point this out.
Regards,
-Markus
next prev parent reply other threads:[~2014-06-23 19:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-21 3:58 Jason Cooper
2014-06-23 19:54 ` Markus Mayer [this message]
2014-07-01 20:04 ` Paul Bolle
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=1403553248-16536-1-git-send-email-markus.mayer@linaro.org \
--to=markus.mayer@linaro.org \
--cc=jason@lakedaemon.net \
--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®