[PATCH] drivers/char: Use ARRAY_SIZE macro
Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove duplicates of ARRAY_SIZE. Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
3c6bee1d40
commit
fe971071a8
@@ -116,7 +116,7 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout);
|
||||
|
||||
static struct serial_state rs_table[1];
|
||||
|
||||
#define NR_PORTS (sizeof(rs_table)/sizeof(struct serial_state))
|
||||
#define NR_PORTS ARRAY_SIZE(rs_table)
|
||||
|
||||
/*
|
||||
* tmp_buf is used as a temporary buffer by serial_write. We need to
|
||||
|
Reference in New Issue
Block a user