Commit 2b8221e181c128ac3bc7a9cdc80db04884951e89
Committed by
Jens Axboe
1 parent
3f273d301b
Exists in
master
and in
16 other branches
block: Really silence spurious compiler warnings
The uninitialized_var() macro appears to not work on structs... Get rid of it, and manually initialize instead. Signed-off-by: Kent Overstreet <kmo@daterainc.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Showing 1 changed file with 3 additions and 9 deletions Side-by-side Diff
block/blk-merge.c
... | ... | @@ -86,11 +86,9 @@ |
86 | 86 | static int blk_phys_contig_segment(struct request_queue *q, struct bio *bio, |
87 | 87 | struct bio *nxt) |
88 | 88 | { |
89 | - struct bio_vec end_bv, nxt_bv; | |
89 | + struct bio_vec end_bv = { NULL }, nxt_bv; | |
90 | 90 | struct bvec_iter iter; |
91 | 91 | |
92 | - uninitialized_var(end_bv); | |
93 | - | |
94 | 92 | if (!blk_queue_cluster(q)) |
95 | 93 | return 0; |
96 | 94 | |
97 | 95 | |
... | ... | @@ -170,13 +168,11 @@ |
170 | 168 | int blk_rq_map_sg(struct request_queue *q, struct request *rq, |
171 | 169 | struct scatterlist *sglist) |
172 | 170 | { |
173 | - struct bio_vec bvec, bvprv; | |
171 | + struct bio_vec bvec, bvprv = { NULL }; | |
174 | 172 | struct req_iterator iter; |
175 | 173 | struct scatterlist *sg; |
176 | 174 | int nsegs, cluster; |
177 | 175 | |
178 | - uninitialized_var(bvprv); | |
179 | - | |
180 | 176 | nsegs = 0; |
181 | 177 | cluster = blk_queue_cluster(q); |
182 | 178 | |
183 | 179 | |
... | ... | @@ -234,12 +230,10 @@ |
234 | 230 | int blk_bio_map_sg(struct request_queue *q, struct bio *bio, |
235 | 231 | struct scatterlist *sglist) |
236 | 232 | { |
237 | - struct bio_vec bvec, bvprv; | |
233 | + struct bio_vec bvec, bvprv = { NULL }; | |
238 | 234 | struct scatterlist *sg; |
239 | 235 | int nsegs, cluster; |
240 | 236 | struct bvec_iter iter; |
241 | - | |
242 | - uninitialized_var(bvprv); | |
243 | 237 | |
244 | 238 | nsegs = 0; |
245 | 239 | cluster = blk_queue_cluster(q); |