block: fix bogus gcc warning for uninitialized var usage
authorJens Axboe <jens.axboe@oracle.com>
Thu, 19 Feb 2009 07:50:26 +0000 (08:50 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 26 Feb 2009 09:45:48 +0000 (10:45 +0100)
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>
fs/bio.c

index 72ab251cdb9cd0c527b8c18c58f9ca6bca1ed621..124b95c4d58286649d8d0f982edd9074af18ac82 100644 (file)
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -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);