Skip to contentSkip to conversation

Fix compilation error caused by BUILD_BUG_ON() in 2.6.32-rc2 kernel

atmel-serial Yegor Yefremov 1 participant 1 message Sep 30, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Fix compilation error caused by BUILD_BUG_ON() in 2.6.32-rc2 kernel.

Add ring buffer size requirements to the macro definition instead of calling BUILD_BUG_ON().

See the following thread for details:
http://www.gossamer-threads.com/lists/linux/kernel/1118447?page=last

drivers/serial/atmel_serial.c +1 -2
Index: linus2/drivers/serial/atmel_serial.c
===================================================================
@@ -123,6 +123,7 @@ struct atmel_uart_char {
 	u16		ch;
 };
 
+/* the ring buffer size must be the power of 2 */
 #define ATMEL_SERIAL_RINGSIZE 1024
 
 /*
@@ -1531,8 +1532,6 @@ static int __devinit atmel_serial_probe(
 	void *data;
 	int ret;
 
-	BUILD_BUG_ON(!is_power_of_2(ATMEL_SERIAL_RINGSIZE));
-
 	port = &atmel_ports[pdev->id];
 	port->backup_imr = 0;