summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>1999-02-04 03:27:43 +0000
committermsmith <msmith@FreeBSD.org>1999-02-04 03:27:43 +0000
commita05a2cf59eeacb0c50beeb8beb15b76fab78a5f4 (patch)
treeca18779d5df7e8396d0b9726e74f8e4129319d57 /sys/netinet
parent8ec612746809f0eefd72a3856422964c21388e04 (diff)
downloadFreeBSD-src-a05a2cf59eeacb0c50beeb8beb15b76fab78a5f4.zip
FreeBSD-src-a05a2cf59eeacb0c50beeb8beb15b76fab78a5f4.tar.gz
Nuke all the stupid ffs() stuff and use powerof2() instead.
Submitted by: Bruce Evans <bde@zeta.org.au>
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/tcp_subr.c4
-rw-r--r--sys/netinet/tcp_timewait.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 49c1709..b9355da 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95
- * $Id: tcp_subr.c,v 1.50 1999/02/03 08:59:30 msmith Exp $
+ * $Id: tcp_subr.c,v 1.51 1999/02/04 03:02:56 msmith Exp $
*/
#include "opt_compat.h"
@@ -136,7 +136,7 @@ tcp_init()
tcbinfo.listhead = &tcb;
if (!(getenv_int("net.inet.tcp.tcbhashsize", &hashsize)))
hashsize = TCBHASHSIZE;
- if ((1 << (ffs(hashsize) - 1)) != hashsize) {
+ if (!powerof2(hashsize)) {
printf("WARNING: TCB hash size not a power of 2\n");
hashsize = 512; /* safe default */
}
diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c
index 49c1709..b9355da 100644
--- a/sys/netinet/tcp_timewait.c
+++ b/sys/netinet/tcp_timewait.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95
- * $Id: tcp_subr.c,v 1.50 1999/02/03 08:59:30 msmith Exp $
+ * $Id: tcp_subr.c,v 1.51 1999/02/04 03:02:56 msmith Exp $
*/
#include "opt_compat.h"
@@ -136,7 +136,7 @@ tcp_init()
tcbinfo.listhead = &tcb;
if (!(getenv_int("net.inet.tcp.tcbhashsize", &hashsize)))
hashsize = TCBHASHSIZE;
- if ((1 << (ffs(hashsize) - 1)) != hashsize) {
+ if (!powerof2(hashsize)) {
printf("WARNING: TCB hash size not a power of 2\n");
hashsize = 512; /* safe default */
}
OpenPOWER on IntegriCloud