Commit 2b1eaa66 authored by Colin Ian King's avatar Colin Ian King Committed by David S. Miller

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: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent faa9b39f
...@@ -103,7 +103,7 @@ static struct be_cmd_priv_map cmd_priv_map[] = { ...@@ -103,7 +103,7 @@ static struct be_cmd_priv_map cmd_priv_map[] = {
static bool be_cmd_allowed(struct be_adapter *adapter, u8 opcode, u8 subsystem) static bool be_cmd_allowed(struct be_adapter *adapter, u8 opcode, u8 subsystem)
{ {
int i; int i;
int num_entries = sizeof(cmd_priv_map)/sizeof(struct be_cmd_priv_map); int num_entries = ARRAY_SIZE(cmd_priv_map);
u32 cmd_privileges = adapter->cmd_privileges; u32 cmd_privileges = adapter->cmd_privileges;
for (i = 0; i < num_entries; i++) for (i = 0; i < num_entries; i++)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment