* [PATCH] Fix Trivial Warnining in drivers/ata/libata-scsi.c
@ 2009-04-27 10:31 Subrata Modak
2009-04-27 12:03 ` Jeff Garzik
0 siblings, 1 reply; 3+ messages in thread
From: Subrata Modak @ 2009-04-27 10:31 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Sachin P Sant, linux-ide, Subrata Modak, Balbir Singh
Hi Jeff,
I observed the following warning for drivers/ata/libata-scsi.c:
drivers/ata/libata-scsi.c: In function âata_scsi_scan_hostâ:
drivers/ata/libata-scsi.c:3272: warning: âdevâ may be used uninitialized in this function
---
In most instances=>
struct ata_device *dev
has been initialized except the above instance. My trivial patch below fixes this.
Please include it if you like it.
To: Jeff Garzik <jgarzik@pobox.com>
Cc: linux-ide@vger.kernel.org
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: Sachin P Sant <sachinp@linux.vnet.ibm.com>
Signed-Off-By: Subrata Modak <subrata@linux.vnet.ibm.com>
---
--- a/drivers/ata/libata-scsi.c 2009-04-27 11:39:27.000000000 +0530
+++ b/drivers/ata/libata-scsi.c 2009-04-27 15:52:17.000000000 +0530
@@ -3269,7 +3269,7 @@ void ata_scsi_scan_host(struct ata_port
int tries = 5;
struct ata_device *last_failed_dev = NULL;
struct ata_link *link;
- struct ata_device *dev;
+ struct ata_device *dev = NULL;
if (ap->flags & ATA_FLAG_DISABLED)
return;
---
Regards--
Subrata
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix Trivial Warnining in drivers/ata/libata-scsi.c
2009-04-27 10:31 [PATCH] Fix Trivial Warnining in drivers/ata/libata-scsi.c Subrata Modak
@ 2009-04-27 12:03 ` Jeff Garzik
2009-04-27 13:01 ` Subrata Modak
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Garzik @ 2009-04-27 12:03 UTC (permalink / raw)
To: Subrata Modak; +Cc: Sachin P Sant, linux-ide, Balbir Singh
Subrata Modak wrote:
> Hi Jeff,
>
> I observed the following warning for drivers/ata/libata-scsi.c:
>
> drivers/ata/libata-scsi.c: In function ‘ata_scsi_scan_host’:
> drivers/ata/libata-scsi.c:3272: warning: ‘dev’ may be used uninitialized in this function
> ---
>
> In most instances=>
> struct ata_device *dev
> has been initialized except the above instance. My trivial patch below fixes this.
> Please include it if you like it.
>
> To: Jeff Garzik <jgarzik@pobox.com>
> Cc: linux-ide@vger.kernel.org
> Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
> Cc: Sachin P Sant <sachinp@linux.vnet.ibm.com>
> Signed-Off-By: Subrata Modak <subrata@linux.vnet.ibm.com>
> ---
>
> --- a/drivers/ata/libata-scsi.c 2009-04-27 11:39:27.000000000 +0530
> +++ b/drivers/ata/libata-scsi.c 2009-04-27 15:52:17.000000000 +0530
> @@ -3269,7 +3269,7 @@ void ata_scsi_scan_host(struct ata_port
> int tries = 5;
> struct ata_device *last_failed_dev = NULL;
> struct ata_link *link;
> - struct ata_device *dev;
> + struct ata_device *dev = NULL;
>
> if (ap->flags & ATA_FLAG_DISABLED)
What was the conclusion of the analysis? :)
Is this a kernel bug, or gcc bug?
Jeff
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix Trivial Warnining in drivers/ata/libata-scsi.c
2009-04-27 12:03 ` Jeff Garzik
@ 2009-04-27 13:01 ` Subrata Modak
0 siblings, 0 replies; 3+ messages in thread
From: Subrata Modak @ 2009-04-27 13:01 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Sachin P Sant, linux-ide, Balbir Singh
Hi Jeff,
On Mon, 2009-04-27 at 08:03 -0400, Jeff Garzik wrote:
> Subrata Modak wrote:
> > Hi Jeff,
> >
> > I observed the following warning for drivers/ata/libata-scsi.c:
> >
> > drivers/ata/libata-scsi.c: In function ‘ata_scsi_scan_host’:
> > drivers/ata/libata-scsi.c:3272: warning: ‘dev’ may be used uninitialized in this function
> > ---
> >
> > In most instances=>
> > struct ata_device *dev
> > has been initialized except the above instance. My trivial patch below fixes this.
> > Please include it if you like it.
> >
> > To: Jeff Garzik <jgarzik@pobox.com>
> > Cc: linux-ide@vger.kernel.org
> > Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
> > Cc: Sachin P Sant <sachinp@linux.vnet.ibm.com>
> > Signed-Off-By: Subrata Modak <subrata@linux.vnet.ibm.com>
> > ---
> >
> > --- a/drivers/ata/libata-scsi.c 2009-04-27 11:39:27.000000000 +0530
> > +++ b/drivers/ata/libata-scsi.c 2009-04-27 15:52:17.000000000 +0530
> > @@ -3269,7 +3269,7 @@ void ata_scsi_scan_host(struct ata_port
> > int tries = 5;
> > struct ata_device *last_failed_dev = NULL;
> > struct ata_link *link;
> > - struct ata_device *dev;
> > + struct ata_device *dev = NULL;
> >
> > if (ap->flags & ATA_FLAG_DISABLED)
>
> What was the conclusion of the analysis? :)
>
> Is this a kernel bug, or gcc bug?
Oops. I just wrote the patch to disable the build warning. As, i found
that in other instances of use of the same declaration, it has been
initialized, and the compiler was complaining for this instance alone.
Hence, thought of addressing through a small fix.
Regards--
Subrata
>
> Jeff
>
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-04-27 13:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-27 10:31 [PATCH] Fix Trivial Warnining in drivers/ata/libata-scsi.c Subrata Modak
2009-04-27 12:03 ` Jeff Garzik
2009-04-27 13:01 ` Subrata Modak
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.