[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
@@ -448,7 +448,7 @@ static int __init moxa_init(void)
|
||||
#ifdef CONFIG_PCI
|
||||
{
|
||||
struct pci_dev *p = NULL;
|
||||
int n = (sizeof(moxa_pcibrds) / sizeof(moxa_pcibrds[0])) - 1;
|
||||
int n = ARRAY_SIZE(moxa_pcibrds) - 1;
|
||||
i = 0;
|
||||
while (i < n) {
|
||||
while ((p = pci_get_device(moxa_pcibrds[i].vendor, moxa_pcibrds[i].device, p))!=NULL)
|
||||
|
Reference in New Issue
Block a user