Nuke all the stupid ffs() stuff and use powerof2() instead.
Submitted by: Bruce Evans <bde@zeta.org.au>
This commit is contained in:
parent
609b6256fd
commit
ea95d6917a
@ -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 */
|
||||
}
|
||||
|
@ -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 */
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user