From 9329f4e4d261bb026b53565e22b7fab1d2973cd0 Mon Sep 17 00:00:00 2001 From: "Robert P. J. Day" Date: Thu, 13 Dec 2007 16:02:55 -0800 Subject: [PATCH] pcmcia net: use roundup_pow_of_two() macro instead of grotesque loop Signed-off-by: Robert P. J. Day Cc: Jeff Garzik Cc: Dominik Brodowski Signed-off-by: Andrew Morton Signed-off-by: Jeff Garzik --- drivers/net/pcmcia/pcnet_cs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index 51bbd582f16c..9ba56aa26a1b 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c @@ -38,6 +38,7 @@ #include #include #include +#include #include "../8390.h" #include @@ -1484,8 +1485,7 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg, window_size = 32 * 1024; /* Make sure it's a power of two. */ - while ((window_size & (window_size - 1)) != 0) - window_size += window_size & ~(window_size - 1); + window_size = roundup_pow_of_two(window_size); /* Allocate a memory window */ req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM|WIN_ENABLE; -- 2.20.1