Thread (5 messages) 5 messages, 2 authors, 2011-07-30

Re: problem on ACS

From: Luis R. Rodriguez <hidden>
Date: 2011-07-29 20:51:16
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

On Fri, Jul 29, 2011 at 12:39 AM, MingAnn Ng [off-list ref] wrote:
Survey 2 from wlan0:
 noise:    -84 dBm
 channel active time:  12 ms
 channel busy time:  0 ms
 channel receive time:  0 ms
 channel transmit time:  0 ms
 interference factor:  9223372036854775815.000000
This is caused by log2(0), this if fixed as follows:

diff --git a/src/ap/acs.c b/src/ap/acs.c
index aa5498e..04b1e31 100644
--- a/src/ap/acs.c
+++ b/src/ap/acs.c
@@ -125,7 +125,7 @@ static u64 min(u64 a, u64 b)
  */
 static u64 log2_sane(u64 val)
 {
-	return log2(min(1073741824, val));
+	return return (!val) ? 0 : log2(min(1073741824, val));
 }

I'll send a new version of the last patch with this fix, thanks for
reporting this.

  Luis
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help