linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] b43: avoid uninitialized variable warnings in phy_n
@ 2011-04-29 18:59 John W. Linville
  2011-04-29 19:21 ` Larry Finger
  0 siblings, 1 reply; 4+ messages in thread
From: John W. Linville @ 2011-04-29 18:59 UTC (permalink / raw)
  To: linux-wireless
  Cc: Rafał Miłecki, Larry Finger, Michael Buesch,
	John W. Linville

  CC [M]  drivers/net/wireless/b43/phy_n.o
drivers/net/wireless/b43/phy_n.c: In function ‘b43_nphy_set_channel’:
drivers/net/wireless/b43/phy_n.c:3848:47: warning: ‘tabent_r2’ may be used uninitialized in this function
drivers/net/wireless/b43/phy_n.c:3849:47: warning: ‘tabent_r3’ may be used uninitialized in this function
drivers/net/wireless/b43/phy_n.c: In function ‘b43_nphy_poll_rssi.clone.14’:
drivers/net/wireless/b43/phy_n.c:2270:6: warning: ‘save_regs_phy$7’ may be used uninitialized in this function
drivers/net/wireless/b43/phy_n.c:2270:6: warning: ‘save_regs_phy$8’ may be used uninitialized in this function

FWIW, the usage of these variables is goverened by checks that match
their initializations.  So, I think these are actually false warnings.
Still, I would rather avoid the warning SPAM...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 drivers/net/wireless/b43/phy_n.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 8a00f9a..6755063 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -2281,6 +2281,7 @@ static int b43_nphy_poll_rssi(struct b43_wldev *dev, u8 type, s32 *buf,
 		save_regs_phy[5] = b43_phy_read(dev, B43_NPHY_AFECTL_OVER);
 		save_regs_phy[6] = b43_phy_read(dev, B43_NPHY_TXF_40CO_B1S0);
 		save_regs_phy[7] = b43_phy_read(dev, B43_NPHY_TXF_40CO_B32S1);
+		save_regs_phy[8] = 0;
 	} else {
 		save_regs_phy[0] = b43_phy_read(dev, B43_NPHY_AFECTL_C1);
 		save_regs_phy[1] = b43_phy_read(dev, B43_NPHY_AFECTL_C2);
@@ -2289,6 +2290,8 @@ static int b43_nphy_poll_rssi(struct b43_wldev *dev, u8 type, s32 *buf,
 		save_regs_phy[4] = b43_phy_read(dev, B43_NPHY_RFCTL_OVER);
 		save_regs_phy[5] = b43_phy_read(dev, B43_NPHY_RFCTL_RSSIO1);
 		save_regs_phy[6] = b43_phy_read(dev, B43_NPHY_RFCTL_RSSIO2);
+		save_regs_phy[7] = 0;
+		save_regs_phy[8] = 0;
 	}
 
 	b43_nphy_rssi_select(dev, 5, type);
@@ -3845,8 +3848,8 @@ static int b43_nphy_set_channel(struct b43_wldev *dev,
 {
 	struct b43_phy *phy = &dev->phy;
 
-	const struct b43_nphy_channeltab_entry_rev2 *tabent_r2;
-	const struct b43_nphy_channeltab_entry_rev3 *tabent_r3;
+	const struct b43_nphy_channeltab_entry_rev2 *tabent_r2 = NULL;
+	const struct b43_nphy_channeltab_entry_rev3 *tabent_r3 = NULL;
 
 	u8 tmp;
 
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] b43: avoid uninitialized variable warnings in phy_n
  2011-04-29 18:59 [PATCH] b43: avoid uninitialized variable warnings in phy_n John W. Linville
@ 2011-04-29 19:21 ` Larry Finger
  2011-04-29 19:43   ` John W. Linville
  0 siblings, 1 reply; 4+ messages in thread
From: Larry Finger @ 2011-04-29 19:21 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, Rafał Miłecki, Michael Buesch

On 04/29/2011 01:59 PM, John W. Linville wrote:
>    CC [M]  drivers/net/wireless/b43/phy_n.o
> drivers/net/wireless/b43/phy_n.c: In function ‘b43_nphy_set_channel’:
> drivers/net/wireless/b43/phy_n.c:3848:47: warning: ‘tabent_r2’ may be used uninitialized in this function
> drivers/net/wireless/b43/phy_n.c:3849:47: warning: ‘tabent_r3’ may be used uninitialized in this function
> drivers/net/wireless/b43/phy_n.c: In function ‘b43_nphy_poll_rssi.clone.14’:
> drivers/net/wireless/b43/phy_n.c:2270:6: warning: ‘save_regs_phy$7’ may be used uninitialized in this function
> drivers/net/wireless/b43/phy_n.c:2270:6: warning: ‘save_regs_phy$8’ may be used uninitialized in this function
>
> FWIW, the usage of these variables is goverened by checks that match
> their initializations.  So, I think these are actually false warnings.
> Still, I would rather avoid the warning SPAM...
>
> Signed-off-by: John W. Linville<linville@tuxdriver.com>
> ---
>   drivers/net/wireless/b43/phy_n.c |    7 +++++--
>   1 files changed, 5 insertions(+), 2 deletions(-)
>

If you s/goverened/governed/ in the commit message, then ACK.

For my info, what compiler version and architecture shows these warnings? I 
don't see them with gcc v4.5.1 on x86_64.

Larry

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] b43: avoid uninitialized variable warnings in phy_n
  2011-04-29 19:21 ` Larry Finger
@ 2011-04-29 19:43   ` John W. Linville
  2011-04-30 17:27     ` Rafał Miłecki
  0 siblings, 1 reply; 4+ messages in thread
From: John W. Linville @ 2011-04-29 19:43 UTC (permalink / raw)
  To: Larry Finger; +Cc: linux-wireless, Rafał Miłecki, Michael Buesch

On Fri, Apr 29, 2011 at 02:21:43PM -0500, Larry Finger wrote:
> On 04/29/2011 01:59 PM, John W. Linville wrote:
> >   CC [M]  drivers/net/wireless/b43/phy_n.o
> >drivers/net/wireless/b43/phy_n.c: In function ‘b43_nphy_set_channel’:
> >drivers/net/wireless/b43/phy_n.c:3848:47: warning: ‘tabent_r2’ may be used uninitialized in this function
> >drivers/net/wireless/b43/phy_n.c:3849:47: warning: ‘tabent_r3’ may be used uninitialized in this function
> >drivers/net/wireless/b43/phy_n.c: In function ‘b43_nphy_poll_rssi.clone.14’:
> >drivers/net/wireless/b43/phy_n.c:2270:6: warning: ‘save_regs_phy$7’ may be used uninitialized in this function
> >drivers/net/wireless/b43/phy_n.c:2270:6: warning: ‘save_regs_phy$8’ may be used uninitialized in this function
> >
> >FWIW, the usage of these variables is goverened by checks that match
> >their initializations.  So, I think these are actually false warnings.
> >Still, I would rather avoid the warning SPAM...
> >
> >Signed-off-by: John W. Linville<linville@tuxdriver.com>
> >---
> >  drivers/net/wireless/b43/phy_n.c |    7 +++++--
> >  1 files changed, 5 insertions(+), 2 deletions(-)
> >
> 
> If you s/goverened/governed/ in the commit message, then ACK.
> 
> For my info, what compiler version and architecture shows these
> warnings? I don't see them with gcc v4.5.1 on x86_64.
> 
> Larry

/home/linville
[linville-8530p.local]:> gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.5.1/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared
--enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada,lto --enable-plugin --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile
--enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.5.1 20100924 (Red Hat 4.5.1-4) (GCC)

This is on Fedora 14, FWIW...

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] b43: avoid uninitialized variable warnings in phy_n
  2011-04-29 19:43   ` John W. Linville
@ 2011-04-30 17:27     ` Rafał Miłecki
  0 siblings, 0 replies; 4+ messages in thread
From: Rafał Miłecki @ 2011-04-30 17:27 UTC (permalink / raw)
  To: John W. Linville; +Cc: Larry Finger, linux-wireless, Michael Buesch

2011/4/29 John W. Linville <linville@tuxdriver.com>:
> On Fri, Apr 29, 2011 at 02:21:43PM -0500, Larry Finger wrote:
>> On 04/29/2011 01:59 PM, John W. Linville wrote:
>> >   CC [M]  drivers/net/wireless/b43/phy_n.o
>> >drivers/net/wireless/b43/phy_n.c: In function ‘b43_nphy_set_channel’:
>> >drivers/net/wireless/b43/phy_n.c:3848:47: warning: ‘tabent_r2’ may be used uninitialized in this function
>> >drivers/net/wireless/b43/phy_n.c:3849:47: warning: ‘tabent_r3’ may be used uninitialized in this function
>> >drivers/net/wireless/b43/phy_n.c: In function ‘b43_nphy_poll_rssi.clone.14’:
>> >drivers/net/wireless/b43/phy_n.c:2270:6: warning: ‘save_regs_phy$7’ may be used uninitialized in this function
>> >drivers/net/wireless/b43/phy_n.c:2270:6: warning: ‘save_regs_phy$8’ may be used uninitialized in this function
>> >
>> >FWIW, the usage of these variables is goverened by checks that match
>> >their initializations.  So, I think these are actually false warnings.
>> >Still, I would rather avoid the warning SPAM...
>> >
>> >Signed-off-by: John W. Linville<linville@tuxdriver.com>
>> >---
>> >  drivers/net/wireless/b43/phy_n.c |    7 +++++--
>> >  1 files changed, 5 insertions(+), 2 deletions(-)
>> >
>>
>> If you s/goverened/governed/ in the commit message, then ACK.
>>
>> For my info, what compiler version and architecture shows these
>> warnings? I don't see them with gcc v4.5.1 on x86_64.
>>
>> Larry
>
> /home/linville
> [linville-8530p.local]:> gcc -v
> Using built-in specs.
> COLLECT_GCC=/usr/bin/gcc
> COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.5.1/lto-wrapper
> Target: x86_64-redhat-linux
> Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared
> --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id
> --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,lto --enable-plugin --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile
> --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
> Thread model: posix
> gcc version 4.5.1 20100924 (Red Hat 4.5.1-4) (GCC)
>
> This is on Fedora 14, FWIW...

Hm, weird that older gcc (4.5.0) was smarter about this :|

> gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i586-suse-linux/4.5/lto-wrapper
Target: i586-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada
--enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.5
--enable-ssp --disable-libssp --disable-plugin
--with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux'
--disable-libgcj --disable-libmudflap --with-slibdir=/lib
--with-system-zlib --enable-__cxa_atexit
--enable-libstdcxx-allocator=new --disable-libstdcxx-pch
--enable-version-specific-runtime-libs --program-suffix=-4.5
--enable-linux-futex --without-system-libunwind --enable-gold
--with-plugin-ld=/usr/bin/gold --with-arch-32=i586 --with-tune=generic
--build=i586-suse-linux
Thread model: posix
gcc version 4.5.0 20100604 [gcc-4_5-branch revision 160292] (SUSE Linux)

I didn't see any warning.

-- 
Rafał

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-04-30 17:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-29 18:59 [PATCH] b43: avoid uninitialized variable warnings in phy_n John W. Linville
2011-04-29 19:21 ` Larry Finger
2011-04-29 19:43   ` John W. Linville
2011-04-30 17:27     ` Rafał Miłecki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).