From: Robert P. J. Day Date: Fri, 14 Dec 2007 00:02:55 +0000 (-0800) Subject: pcmcia net: use roundup_pow_of_two() macro instead of grotesque loop X-Git-Tag: v2.6.25-rc1~1162^2~337 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9329f4e4d261bb026b53565e22b7fab1d2973cd0;p=linux-2.6 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 --- diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index 51bbd582f1..9ba56aa26a 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;