Skip to content

Commit 2b1eaa6

Browse files
Colin Ian Kingdavem330
authored andcommitted
be2net: use ARRAY_SIZE for array sizing calculation on array cmd_priv_map
Use the ARRAY_SIZE macro on array cmd_priv_map to determine size of the array. Improvement suggested by coccinelle. Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent faa9b39 commit 2b1eaa6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/emulex/benet/be_cmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static struct be_cmd_priv_map cmd_priv_map[] = {
103103
static bool be_cmd_allowed(struct be_adapter *adapter, u8 opcode, u8 subsystem)
104104
{
105105
int i;
106-
int num_entries = sizeof(cmd_priv_map)/sizeof(struct be_cmd_priv_map);
106+
int num_entries = ARRAY_SIZE(cmd_priv_map);
107107
u32 cmd_privileges = adapter->cmd_privileges;
108108

109109
for (i = 0; i < num_entries; i++)

0 commit comments

Comments
 (0)