summaryrefslogtreecommitdiffstats
path: root/fs/erofs
diff options
context:
space:
mode:
authorGao Xiang <hsiangkao@redhat.com>2020-05-28 04:48:44 -0400
committerGao Xiang <hsiangkao@redhat.com>2020-05-29 18:58:13 +0800
commit34f853b849eb6a509eb8f40f2f5946ebb1f62739 (patch)
tree88f945f684ff341d135f88ceb4f6fd9312f1dbf4 /fs/erofs
parentf57a3fe44995a3820192e0cf7c3ebdecedd9586e (diff)
downloadlinux-34f853b849eb6a509eb8f40f2f5946ebb1f62739.tar.bz2
erofs: suppress false positive last_block warning
As Andrew mentioned, some rare specific gcc versions could report last_block uninitialized warning. Actually last_block doesn't need to be uninitialized first from its implementation due to bio == NULL condition. After a bio is allocated, last_block will be assigned then. The detailed analysis is in this thread [1]. So let's silence those confusing gccs simply. [1] https://lore.kernel.org/r/20200421072839.GA13867@hsiangkao-HP-ZHAN-66-Pro-G1 Cc: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Chao Yu <yuchao0@huawei.com> Link: https://lore.kernel.org/r/20200528084844.23359-1-hsiangkao@redhat.com Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
Diffstat (limited to 'fs/erofs')
-rw-r--r--fs/erofs/data.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/erofs/data.c b/fs/erofs/data.c
index fc3a8d8064f8..2812645b361e 100644
--- a/fs/erofs/data.c
+++ b/fs/erofs/data.c
@@ -265,7 +265,7 @@ submit_bio_out:
*/
static int erofs_raw_access_readpage(struct file *file, struct page *page)
{
- erofs_off_t last_block;
+ erofs_off_t uninitialized_var(last_block);
struct bio *bio;
trace_erofs_readpage(page, true);
@@ -285,7 +285,7 @@ static int erofs_raw_access_readpages(struct file *filp,
struct list_head *pages,
unsigned int nr_pages)
{
- erofs_off_t last_block;
+ erofs_off_t uninitialized_var(last_block);
struct bio *bio = NULL;
gfp_t gfp = readahead_gfp_mask(mapping);
struct page *page = list_last_entry(pages, struct page, lru);