Skip to content

Commit

Permalink
block: fix bogus gcc warning for uninitialized var usage
Browse files Browse the repository at this point in the history
Newer gcc throw this warning:

        fs/bio.c: In function ?bio_alloc_bioset?:
        fs/bio.c:305: warning: ?p? may be used uninitialized in this function

since it cannot figure out that 'p' is only ever used if 'bs' is non-NULL.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
Jens Axboe committed Feb 26, 2009
1 parent 169d418 commit b2bf968
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 @@ -302,7 +302,7 @@ void bio_init(struct bio *bio)
struct bio *bio_alloc_bioset(gfp_t gfp_mask, int nr_iovecs, struct bio_set *bs)
{
struct bio *bio = NULL;
void *p;
void *uninitialized_var(p);

if (bs) {
p = mempool_alloc(bs->bio_pool, gfp_mask);
Expand Down

0 comments on commit b2bf968

Please sign in to comment.