* [PATCH] b43legacy: Fix sparse warnings
@ 2008-12-10 5:35 Larry Finger
2008-12-10 10:33 ` Michael Buesch
0 siblings, 1 reply; 3+ messages in thread
From: Larry Finger @ 2008-12-10 5:35 UTC (permalink / raw)
To: Michael Buesch, John W Linville; +Cc: bcm43xx-dev, linux-wireless
Sparse yields the following warnings for b43legacy:
CHECK drivers/net/wireless/b43legacy/phy.c
drivers/net/wireless/b43legacy/phy.c:1304:31: warning: potentially expensive pointer subtraction
drivers/net/wireless/b43legacy/phy.c:1304:31: warning: potentially expensive pointer subtraction
drivers/net/wireless/b43legacy/phy.c:1304:31: warning: potentially expensive pointer subtraction
CHECK drivers/net/wireless/b43legacy/debugfs.c
drivers/net/wireless/b43legacy/debugfs.c:243:9: warning: memset with byte count of 131072
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
John,
This is 2.6.29 material.
Larry
---
Index: wireless-testing/drivers/net/wireless/b43legacy/debugfs.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43legacy/debugfs.c
+++ wireless-testing/drivers/net/wireless/b43legacy/debugfs.c
@@ -211,7 +211,7 @@ static ssize_t b43legacy_debugfs_read(st
struct b43legacy_dfs_file *dfile;
ssize_t uninitialized_var(ret);
char *buf;
- const size_t bufsize = 1024 * 128;
+ const size_t bufsize = 1024 * 16; /* 16 KiB buffer */
const size_t buforder = get_order(bufsize);
int err = 0;
Index: wireless-testing/drivers/net/wireless/b43legacy/phy.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43legacy/phy.c
+++ wireless-testing/drivers/net/wireless/b43legacy/phy.c
@@ -1296,12 +1296,10 @@ void b43legacy_lo_write(struct b43legacy
/* Sanity check. */
if (pair->low < -8 || pair->low > 8 ||
pair->high < -8 || pair->high > 8) {
- struct b43legacy_phy *phy = &dev->phy;
b43legacydbg(dev->wl,
"WARNING: Writing invalid LOpair "
- "(low: %d, high: %d, index: %lu)\n",
- pair->low, pair->high,
- (unsigned long)(pair - phy->_lo_pairs));
+ "(low: %d, high: %d)\n",
+ pair->low, pair->high);
dump_stack();
}
#endif
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] b43legacy: Fix sparse warnings
2008-12-10 5:35 [PATCH] b43legacy: Fix sparse warnings Larry Finger
@ 2008-12-10 10:33 ` Michael Buesch
2008-12-10 16:45 ` Larry Finger
0 siblings, 1 reply; 3+ messages in thread
From: Michael Buesch @ 2008-12-10 10:33 UTC (permalink / raw)
To: Larry Finger; +Cc: John W Linville, bcm43xx-dev, linux-wireless
On Wednesday 10 December 2008 06:35:41 Larry Finger wrote:
> CHECK drivers/net/wireless/b43legacy/debugfs.c
> drivers/net/wireless/b43legacy/debugfs.c:243:9: warning: memset with byte count of 131072
I know about this error and I think it's a damn stupid error.
There is a reason why the value was so high in b43. I don't know about b43legacy.
Did you check if all callbacks still work properly?
> Index: wireless-testing/drivers/net/wireless/b43legacy/debugfs.c
> ===================================================================
> --- wireless-testing.orig/drivers/net/wireless/b43legacy/debugfs.c
> +++ wireless-testing/drivers/net/wireless/b43legacy/debugfs.c
> @@ -211,7 +211,7 @@ static ssize_t b43legacy_debugfs_read(st
> struct b43legacy_dfs_file *dfile;
> ssize_t uninitialized_var(ret);
> char *buf;
> - const size_t bufsize = 1024 * 128;
> + const size_t bufsize = 1024 * 16; /* 16 KiB buffer */
> const size_t buforder = get_order(bufsize);
> int err = 0;
--
Greetings, Michael.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] b43legacy: Fix sparse warnings
2008-12-10 10:33 ` Michael Buesch
@ 2008-12-10 16:45 ` Larry Finger
0 siblings, 0 replies; 3+ messages in thread
From: Larry Finger @ 2008-12-10 16:45 UTC (permalink / raw)
To: Michael Buesch; +Cc: John W Linville, bcm43xx-dev, linux-wireless
Michael Buesch wrote:
> On Wednesday 10 December 2008 06:35:41 Larry Finger wrote:
>> CHECK drivers/net/wireless/b43legacy/debugfs.c
>> drivers/net/wireless/b43legacy/debugfs.c:243:9: warning: memset with byte count of 131072
>
> I know about this error and I think it's a damn stupid error.
> There is a reason why the value was so high in b43. I don't know about b43legacy.
> Did you check if all callbacks still work properly?
Yes. AFAIK, everything works correctly. BTW, I chose 16 KiB because that is the
number in b43, and I expected the two drivers to need about the same amount of
buffer space. Was that a bad assumption?
Larry
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-12-10 16:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-10 5:35 [PATCH] b43legacy: Fix sparse warnings Larry Finger
2008-12-10 10:33 ` Michael Buesch
2008-12-10 16:45 ` Larry Finger
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).