block: use unitialized_var() in bio_alloc_bioset()

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git-commits-head@...>
Date: Thursday, May 8, 2008 - 5:59 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=eeae1d...
Commit:     eeae1d48c011839d9e1cdc1e8aacf0193c9d8197
Parent:     28f13702f03e527fcb979747a882cf366c489c50
Author:     Jens Axboe <jens.axboe@oracle.com>
AuthorDate: Wed May 7 13:26:27 2008 +0200
Committer:  Jens Axboe <jens.axboe@oracle.com>
CommitDate: Wed May 7 13:26:27 2008 +0200

    block: use unitialized_var() in bio_alloc_bioset()
    
    Better than setting idx to some random value and it silences the
    same bogus gcc warning.
    
    Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
---
 fs/bio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/bio.c b/fs/bio.c
index 799f86d..2fa04ff 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -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)) {
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
block: use unitialized_var() in bio_alloc_bioset(), Linux Kernel Mailing List..., (Thu May 8, 5:59 pm)