[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
@@ -5104,7 +5104,7 @@ void tx_load_dma_buffer(SLMP_INFO *info, const char *buf, unsigned int count)
|
||||
int register_test(SLMP_INFO *info)
|
||||
{
|
||||
static unsigned char testval[] = {0x00, 0xff, 0xaa, 0x55, 0x69, 0x96};
|
||||
static unsigned int count = sizeof(testval)/sizeof(unsigned char);
|
||||
static unsigned int count = ARRAY_SIZE(testval);
|
||||
unsigned int i;
|
||||
int rc = TRUE;
|
||||
unsigned long flags;
|
||||
@@ -5422,7 +5422,7 @@ int memory_test(SLMP_INFO *info)
|
||||
{
|
||||
static unsigned long testval[] = { 0x0, 0x55555555, 0xaaaaaaaa,
|
||||
0x66666666, 0x99999999, 0xffffffff, 0x12345678 };
|
||||
unsigned long count = sizeof(testval)/sizeof(unsigned long);
|
||||
unsigned long count = ARRAY_SIZE(testval);
|
||||
unsigned long i;
|
||||
unsigned long limit = SCA_MEM_SIZE/sizeof(unsigned long);
|
||||
unsigned long * addr = (unsigned long *)info->memory_base;
|
||||
|
Reference in New Issue
Block a user