Skip to contentSkip to conversation

fs/bio.c: initialize variable, remove warning

PATCH In review Petri T. Koistinen 5 participants 5 messages May 1, 2006 – May 2, 2006 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs/bio.c: initialize variable, remove warning

From: Petri T. Koistinen <[email protected]>

Remove compiler warning by initializing uninitialized variable.

---
 fs/bio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

---

fs/bio.c +1 -1
index eb8fbc5..c4deed9 100644
@@ -166,7 +166,7 @@ struct bio *bio_alloc_bioset(gfp_t gfp_m
 
 		bio_init(bio);
 		if (likely(nr_iovecs)) {
-			unsigned long idx;
+			unsigned long idx = 0;
 
 			bvl = bvec_alloc_bs(gfp_mask, nr_iovecs, &idx, bs);
 			if (unlikely(!bvl)) {
#1 lore raw

fs/bio.c struct bio *bio_alloc_bioset(gfp_t gfp_m · line 169

Quoted 10 lines · Petri T. Koistinen

Remove compiler warning by initializing uninitialized variable.

fs/bio.c +1 -1
@@ -166,7 +166,7 @@ struct bio *bio_alloc_bioset(gfp_t gfp_m
 
 		bio_init(bio);
 		if (likely(nr_iovecs)) {
-			unsigned long idx;
+			unsigned long idx = 0;

oh no not again!

#2 lore raw
Quoted 4 lines · Alexey Dobriyan
Quoted 1 line · Petri T. Koistinen

Remove compiler warning by initializing uninitialized variable.

oh no not again!

What about:

Quoted 1 line
Quoted 1 line

- unsigned long idx;

+ unsigned long idx; /* please don't patch bogus
warning */

:)
-Bob

#3 lore raw
Quoted 11 lines · Bob Copeland
Quoted 4 lines · Alexey Dobriyan
Quoted 1 line · Petri T. Koistinen

Remove compiler warning by initializing uninitialized variable.

oh no not again!

What about:

Quoted 1 line
Quoted 1 line

- unsigned long idx;

+ unsigned long idx; /* please don't patch bogus
warning */

I'll take that patch if you send it :-)

Signature · 1 line
Jens Axboe