Re: [PATCH] block: Fix compiler warnings in blk-merge.c

From: Jens Axboe
Date: Tue Sep 08 2015 - 11:19:19 EST


On 09/06/2015 09:24 AM, Geliang Tang wrote:
Fix the following warnings:

CC block/blk-merge.o
In file included from block/blk-merge.c:7:0:
block/blk-merge.c: In function âblk_queue_splitâ:
include/linux/blkdev.h:1368:21: warning: âbvprv.bv_offsetâ may be used
uninitialized in this function [-Wmaybe-uninitialized]
((bprv->bv_offset + bprv->bv_len) & queue_virt_boundary(q));
^
block/blk-merge.c:70:21: note: âbvprv.bv_offsetâ was declared here
struct bio_vec bv, bvprv;
^
In file included from block/blk-merge.c:7:0:
include/linux/blkdev.h:1368:21: warning: âbvprv.bv_lenâ may be used
uninitialized in this function [-Wmaybe-uninitialized]
((bprv->bv_offset + bprv->bv_len) & queue_virt_boundary(q));
^
block/blk-merge.c:70:21: note: âbvprv.bv_lenâ was declared here
struct bio_vec bv, bvprv;
^
In file included from ./arch/x86/include/asm/page.h:70:0,
from ./arch/x86/include/asm/thread_info.h:11,
from include/linux/thread_info.h:54,
from ./arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:64,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/linux/stat.h:18,
from include/linux/module.h:10,
from block/blk-merge.c:5:
include/asm-generic/memory_model.h:52:52: warning: âbvprv.bv_pageâ may
be used uninitialized in this function [-Wmaybe-uninitialized]
#define __page_to_pfn(page) (unsigned long)((page) - vmemmap)
^
block/blk-merge.c:70:21: note: âbvprv.bv_pageâ was declared here
struct bio_vec bv, bvprv;

There's already a fix queued up for that, which doesn't require bvprv to be cleared to 0:

http://git.kernel.dk/cgit/linux-block/commit/?h=for-linus&id=5014c311baa2b21384321fa4a9f617a92e3e56f0

--
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/