Skip to content

Commit 34f853b

Browse files
author
Gao Xiang
committed
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 <[email protected]> Reviewed-by: Chao Yu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Gao Xiang <[email protected]>
1 parent f57a3fe commit 34f853b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/erofs/data.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ static inline struct bio *erofs_read_raw_page(struct bio *bio,
265265
*/
266266
static int erofs_raw_access_readpage(struct file *file, struct page *page)
267267
{
268-
erofs_off_t last_block;
268+
erofs_off_t uninitialized_var(last_block);
269269
struct bio *bio;
270270

271271
trace_erofs_readpage(page, true);
@@ -285,7 +285,7 @@ static int erofs_raw_access_readpages(struct file *filp,
285285
struct list_head *pages,
286286
unsigned int nr_pages)
287287
{
288-
erofs_off_t last_block;
288+
erofs_off_t uninitialized_var(last_block);
289289
struct bio *bio = NULL;
290290
gfp_t gfp = readahead_gfp_mask(mapping);
291291
struct page *page = list_last_entry(pages, struct page, lru);

0 commit comments

Comments
 (0)