Re: [PATCH] drivers/ide/ide-probe.c: uninitialized variable 'rc'

From: Bartlomiej Zolnierkiewicz
Date: Sun Oct 05 2008 - 12:45:55 EST


On Saturday 27 September 2008, Bartlomiej Zolnierkiewicz wrote:
> On Thursday 11 September 2008, Steven Noonan wrote:
> > On Wed, Sep 10, 2008 at 3:40 PM, Elias Oltmanns <eo@xxxxxxxxxxxxxx> wrote:
> > >
> > > What about changing the declaration to
> > >
> > > int i, uninitialized_var(rc);
> > >
> > > then?
> > >
> >
> > That's probably a -much- better idea. I'm an utter newbie to kernel
> > development, so I wasn't aware of that feature.
>
> Did I miss the final patch version?
>
> [ Could you please re-send and/or re-cast it? ]

Oh, well...

From: Bartlomiej Zolnierkiewicz <bzolnier@xxxxxxxxx>
Subject: [PATCH] ide: workaround for bogus gcc warning in ide_sysfs_register_port()

Reported-by: "Steven Noonan" <steven@xxxxxxxxxxxxxx>
Suggested-by: "Elias Oltmanns" <eo@xxxxxxxxxxxxxx>
Cc: mingo@xxxxxxx
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@xxxxxxxxx>
---
drivers/ide/ide-probe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: b/drivers/ide/ide-probe.c
===================================================================
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1492,7 +1492,7 @@ static struct device_attribute *ide_port

static int ide_sysfs_register_port(ide_hwif_t *hwif)
{
- int i, rc;
+ int i, uninitialized_var(rc);

for (i = 0; ide_port_attrs[i]; i++) {
rc = device_create_file(hwif->portdev, ide_port_attrs[i]);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/