Skip to content

Commit

Permalink
block: Really silence spurious compiler warnings
Browse files Browse the repository at this point in the history
The uninitialized_var() macro appears to not work on structs...
Get rid of it, and manually initialize instead.

Signed-off-by: Kent Overstreet <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Kent Overstreet authored and axboe committed Dec 3, 2013
1 parent 3f273d3 commit 2b8221e
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions block/blk-merge.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,9 @@ EXPORT_SYMBOL(blk_recount_segments);
static int blk_phys_contig_segment(struct request_queue *q, struct bio *bio,
struct bio *nxt)
{
struct bio_vec end_bv, nxt_bv;
struct bio_vec end_bv = { NULL }, nxt_bv;
struct bvec_iter iter;

uninitialized_var(end_bv);

if (!blk_queue_cluster(q))
return 0;

Expand Down Expand Up @@ -170,13 +168,11 @@ __blk_segment_map_sg(struct request_queue *q, struct bio_vec *bvec,
int blk_rq_map_sg(struct request_queue *q, struct request *rq,
struct scatterlist *sglist)
{
struct bio_vec bvec, bvprv;
struct bio_vec bvec, bvprv = { NULL };
struct req_iterator iter;
struct scatterlist *sg;
int nsegs, cluster;

uninitialized_var(bvprv);

nsegs = 0;
cluster = blk_queue_cluster(q);

Expand Down Expand Up @@ -234,13 +230,11 @@ EXPORT_SYMBOL(blk_rq_map_sg);
int blk_bio_map_sg(struct request_queue *q, struct bio *bio,
struct scatterlist *sglist)
{
struct bio_vec bvec, bvprv;
struct bio_vec bvec, bvprv = { NULL };
struct scatterlist *sg;
int nsegs, cluster;
struct bvec_iter iter;

uninitialized_var(bvprv);

nsegs = 0;
cluster = blk_queue_cluster(q);

Expand Down

0 comments on commit 2b8221e

Please sign in to comment.