提交 9329f4e4 编写于 作者: R Robert P. J. Day 提交者: David S. Miller

pcmcia net: use roundup_pow_of_two() macro instead of grotesque loop

Signed-off-by: NRobert P. J. Day <rpjday@crashcourse.ca>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 67b3c27c
......@@ -38,6 +38,7 @@
#include <linux/delay.h>
#include <linux/ethtool.h>
#include <linux/netdevice.h>
#include <linux/log2.h>
#include "../8390.h"
#include <pcmcia/cs_types.h>
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册