diff options
author | Boaz Harrosh <boaz@plexistor.com> | 2014-07-20 11:09:04 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-07-24 12:17:07 +0200 |
commit | 6fcc5420bfb91049a318bb4d88fe471248b5b391 (patch) | |
tree | 7facf80d3bcacbd21131c90721355f7ea0ddb0ee /fs/exofs | |
parent | Merge branch 'for-3.16' of git://linux-nfs.org/~bfields/linux (diff) | |
download | linux-6fcc5420bfb91049a318bb4d88fe471248b5b391.tar.xz linux-6fcc5420bfb91049a318bb4d88fe471248b5b391.zip |
direct-io: fix uninitialized warning in do_direct_IO()
The following warnings:
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
are false positive because dio_get_page() either fails, or sets both
'from' and 'to'.
Paul Bolle said ...
Maybe it's better to move initializing "to" and "from" out of
dio_get_page(). That _might_ make it easier for both the the reader and
the compiler to understand what's going on. Something like this:
Christoph Hellwig said ...
The fix of moving the code definitively looks nicer, while I think
uninitialized_var is horrible wart that won't get anywhere near my code.
Boaz Harrosh: I agree with Christoph and Paul
Signed-off-by: Boaz Harrosh <boaz@plexistor.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/exofs')
0 files changed, 0 insertions, 0 deletions