Skip to content

Commit

Permalink
block: use unitialized_var() in bio_alloc_bioset()
Browse files Browse the repository at this point in the history
Better than setting idx to some random value and it silences the
same bogus gcc warning.

Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Jens Axboe committed May 7, 2008
1 parent 28f1370 commit eeae1d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ struct bio *bio_alloc_bioset(gfp_t gfp_mask, int nr_iovecs, struct bio_set *bs)

bio_init(bio);
if (likely(nr_iovecs)) {
unsigned long idx = 0; /* shut up gcc */
unsigned long uninitialized_var(idx);

bvl = bvec_alloc_bs(gfp_mask, nr_iovecs, &idx, bs);
if (unlikely(!bvl)) {
Expand Down

0 comments on commit eeae1d4

Please sign in to comment.