[PATCH] drivers/ata/sata_via.c - Eliminate "may be used uninitialized" warning - Kernel
This is a discussion on [PATCH] drivers/ata/sata_via.c - Eliminate "may be used uninitialized" warning - Kernel ; Called by svia_init_one with a temporary,
so there's no effective code change.
Signed-off-by: Joe Perches
drivers/ata/sata_via.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/ata/sata_via.c b/drivers/ata/sata_via.c
index 0d03f44..e01d2b1 100644
--- a/drivers/ata/sata_via.c
+++ b/drivers/ata/sata_via.c
@@ -406,10 +406,9 ...
-
[PATCH] drivers/ata/sata_via.c - Eliminate "may be used uninitialized" warning
Called by svia_init_one with a temporary,
so there's no effective code change.
Signed-off-by: Joe Perches
drivers/ata/sata_via.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/ata/sata_via.c b/drivers/ata/sata_via.c
index 0d03f44..e01d2b1 100644
--- a/drivers/ata/sata_via.c
+++ b/drivers/ata/sata_via.c
@@ -406,10 +406,9 @@ static int vt6420_prepare_host(struct pci_dev *pdev, struct ata_host **r_host)
struct ata_host *host;
int rc;
- rc = ata_pci_prepare_sff_host(pdev, ppi, &host);
+ rc = ata_pci_prepare_sff_host(pdev, ppi, r_host);
if (rc)
return rc;
- *r_host = host;
rc = pcim_iomap_regions(pdev, 1 << 5, DRV_NAME);
if (rc) {
@@ -417,6 +416,7 @@ static int vt6420_prepare_host(struct pci_dev *pdev, struct ata_host **r_host)
return rc;
}
+ host = *r_host;
host->ports[0]->ioaddr.scr_addr = svia_scr_addr(host->iomap[5], 0);
host->ports[1]->ioaddr.scr_addr = svia_scr_addr(host->iomap[5], 1);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
-
Re: [PATCH] drivers/ata/sata_via.c - Eliminate "may be used uninitialized" warning
On Sun, Apr 06, 2008 at 02:45:20PM -0700, Joe Perches wrote:
> Called by svia_init_one with a temporary,
> so there's no effective code change.
>...
I'm not getting any warning here.
Are you using an older gcc?
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
-
Re: [PATCH] drivers/ata/sata_via.c - Eliminate "may be used uninitialized" warning
On Mon, 2008-04-07 at 00:50 +0300, Adrian Bunk wrote:
> On Sun, Apr 06, 2008 at 02:45:20PM -0700, Joe Perches wrote:
> > Called by svia_init_one with a temporary,
> > so there's no effective code change.
> I'm not getting any warning here.
> Are you using an older gcc?
Yes. Slightly less than 4.3.0
$ gcc --version
gcc (GCC) 4.2.2 20071128 (prerelease) (4.2.2-3.1mdv2008.0)
$ git-show
commit 6fdf5e67fe8d3c83500dad9acae985132c2459a3
Merge: abd24df... e64a3cf...
Author: Linus Torvalds
Date: Fri Apr 4 15:09:44 2008 -0700
Merge branch 'upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/ralf/upstream-linus
* 'upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/ralf/upstream-linus:
[MIPS] Make KGDB compile on UP
[MIPS] Pb1200: Fix header breakage
$ make defconfig
[]
$ make clean
[]
$ make drivers/ata/sata_via.o
[]
CC drivers/ata/sata_via.o
drivers/ata/sata_via.c: In function ‘svia_init_one’:
drivers/ata/sata_via.c:504: warning: ‘host’ may be used uninitialized in this function
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
-
Re: [PATCH] drivers/ata/sata_via.c - Eliminate "may be used uninitialized" warning
On Sun, Apr 06, 2008 at 03:00:07PM -0700, Joe Perches wrote:
> On Mon, 2008-04-07 at 00:50 +0300, Adrian Bunk wrote:
> > On Sun, Apr 06, 2008 at 02:45:20PM -0700, Joe Perches wrote:
> > > Called by svia_init_one with a temporary,
> > > so there's no effective code change.
> > I'm not getting any warning here.
> > Are you using an older gcc?
>
> Yes. Slightly less than 4.3.0
>
> $ gcc --version
> gcc (GCC) 4.2.2 20071128 (prerelease) (4.2.2-3.1mdv2008.0)
>...
I've reproduced the warning with 4.2 but not with the 4.3 in Debian
unstable.
Jeff is the one to decide about this specific patch.
Independent from this specific patch my opinion is that considering that
we support 7 different release series of gcc aiming for a warning free
compilation with the latest gcc is a good goal, but aiming for a warning
free compilation with all supported gcc release series is not worth it
(especially considering that patches that fix such warnings might even
introduce new bugs).
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/