2006-05-01 20:55:42

by Petri T. Koistinen

[permalink] [raw]
Subject: [PATCH] fs/bio.c: initialize variable, remove warning

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

Remove compiler warning by initializing uninitialized variable.

Signed-off-by: Petri T. Koistinen <[email protected]>
---
fs/bio.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/fs/bio.c b/fs/bio.c
index eb8fbc5..c4deed9 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -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)) {



2006-05-01 21:07:44

by Alexey Dobriyan

[permalink] [raw]
Subject: Re: [PATCH] fs/bio.c: initialize variable, remove warning

On Mon, May 01, 2006 at 11:55:27PM +0300, Petri T. Koistinen wrote:
> Remove compiler warning by initializing uninitialized variable.

> --- a/fs/bio.c
> +++ b/fs/bio.c
> @@ -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!

2006-05-01 21:19:44

by Bob Copeland

[permalink] [raw]
Subject: Re: [PATCH] fs/bio.c: initialize variable, remove warning

On 5/1/06, Alexey Dobriyan <[email protected]> wrote:
> On Mon, May 01, 2006 at 11:55:27PM +0300, Petri T. Koistinen wrote:
> > Remove compiler warning by initializing uninitialized variable.
>
> oh no not again!

What about:

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

:)
-Bob

2006-05-02 00:22:28

by Al Viro

[permalink] [raw]
Subject: Re: [PATCH] fs/bio.c: initialize variable, remove warning

On Mon, May 01, 2006 at 11:55:27PM +0300, Petri T. Koistinen wrote:
> From: Petri T. Koistinen <[email protected]>
>
> Remove compiler warning by initializing uninitialized variable.

NAK. Unless you can show the path where it is used uninitialized,
such patches should not go in.

2006-05-02 05:27:05

by Jens Axboe

[permalink] [raw]
Subject: Re: [PATCH] fs/bio.c: initialize variable, remove warning

On Mon, May 01 2006, Bob Copeland wrote:
> On 5/1/06, Alexey Dobriyan <[email protected]> wrote:
> >On Mon, May 01, 2006 at 11:55:27PM +0300, Petri T. Koistinen wrote:
> >> Remove compiler warning by initializing uninitialized variable.
> >
> >oh no not again!
>
> What about:
>
> >> - unsigned long idx;
> + unsigned long idx; /* please don't patch bogus
> warning */

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

--
Jens Axboe