All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] atmel_serial: Fix bad BUILD_BUG_ON() usage
@ 2009-10-06 16:06 Haavard Skinnemoen
  2009-10-07 13:16 ` Nicolas Ferre
  0 siblings, 1 reply; 3+ messages in thread
From: Haavard Skinnemoen @ 2009-10-06 16:06 UTC (permalink / raw)
  To: Nicolas Ferre; +Cc: Andrew Victor, linux-kernel, akpm, Haavard Skinnemoen

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 <haavard.skinnemoen@atmel.com>
---
 drivers/serial/atmel_serial.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

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;
-- 
1.6.0.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-10-12  7:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-06 16:06 [PATCH] atmel_serial: Fix bad BUILD_BUG_ON() usage Haavard Skinnemoen
2009-10-07 13:16 ` Nicolas Ferre
2009-10-12  7:58   ` Claudio Scordino

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.