projects/linux·commit 9d09daf8

atmel_serial: fix bad BUILD_BUG_ON() usage

9d09daf8 · Haavard Skinnemoen <[email protected]> · 2009-10-26 16:50:02 -07:00

is_power_of_2() appears not to be constant enough for BUILD_BUG_ON()
after the latest rework, so replace it with an open-coded test.

Signed-off-by: Haavard Skinnemoen <[email protected]>
Cc: Uwe Kleine-König <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Haavard Skinnemoen <[email protected]>
Cc: Alan Cox <[email protected]>
Cc: Nicolas Ferre <[email protected]>
Cc: Claudio Scordino <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
9d09daf8e891e6ed60f96fbaf765ba7bced8bad1
Parents
6a7b9548

Changes

1 files changed · +1 −1

FileStatusAddDelContent
drivers/serial/atmel_serial.cmodified+1−1View file

drivers/serial/atmel_serial.c

View file
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c
index 3551c5c..9d948bc 100644
--- a/drivers/serial/atmel_serial.c
+++ b/drivers/serial/atmel_serial.c
@@ -1531,7 +1531,7 @@ static int __devinit atmel_serial_probe(struct platform_device *pdev)
void *data;
int ret;
- BUILD_BUG_ON(!is_power_of_2(ATMEL_SERIAL_RINGSIZE));
+ BUILD_BUG_ON(ATMEL_SERIAL_RINGSIZE & (ATMEL_SERIAL_RINGSIZE - 1));
port = &atmel_ports[pdev->id];
port->backup_imr = 0;