netdev: convert non-obvious instances to use ARRAY_SIZE()
This will convert remaining non-obvious or naive calculations of array sizes to use ARRAY_SIZE() macro. Signed-off-by: Alejandro Martinez Ruiz <alex@flawedcode.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
committed by
Jeff Garzik
parent
88a15f2e28
commit
e9edda697e
@@ -1041,7 +1041,7 @@ static struct InfoLeaf infoleaf_array[] = {
|
||||
{DC21142, dc21142_infoleaf},
|
||||
{DC21143, dc21143_infoleaf}
|
||||
};
|
||||
#define INFOLEAF_SIZE (sizeof(infoleaf_array)/(sizeof(int)+sizeof(int *)))
|
||||
#define INFOLEAF_SIZE ARRAY_SIZE(infoleaf_array)
|
||||
|
||||
/*
|
||||
** List the SROM info block functions
|
||||
@@ -1056,7 +1056,7 @@ static int (*dc_infoblock[])(struct net_device *dev, u_char, u_char *) = {
|
||||
compact_infoblock
|
||||
};
|
||||
|
||||
#define COMPACT (sizeof(dc_infoblock)/sizeof(int *) - 1)
|
||||
#define COMPACT (ARRAY_SIZE(dc_infoblock) - 1)
|
||||
|
||||
/*
|
||||
** Miscellaneous defines...
|
||||
|
Reference in New Issue
Block a user