Skip to contentSkip to conversation

: use ARRAY_SIZE in ColdFire serial driver

M68KNOMMU Greg Ungerer 1 participant 1 message Oct 30, 2007

lore
Share & tools
lore
#0 lore raw

Use ARRAY_SIZE macroto get maximum ports in ColdFire serial driver.

---

drivers/serial/mcf.c +1 -1
diff -Naurp linux-2.6.23-rc1/drivers/serial/mcf.c linux-2.6.23-rc1.platform/drivers/serial/mcf.c
@@ -434,7 +434,7 @@ static struct uart_ops mcf_uart_ops = {
 
 static struct mcf_uart mcf_ports[3];
 
-#define	MCF_MAXPORTS	(sizeof(mcf_ports) / sizeof(struct mcf_uart))
+#define	MCF_MAXPORTS	ARRAY_SIZE(mcf_ports)
 
 /****************************************************************************/
 #if defined(CONFIG_SERIAL_MCF_CONSOLE)