summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2018-01-07 23:45:08 +0000
committerDavid S. Miller <davem@davemloft.net>2018-01-09 11:40:18 -0500
commit2b1eaa66352ac453b44451c230d8edd6c5a5ea80 (patch)
tree85cc29bb170aa22a96ce2b172e5acea6b57cc4d1
parentfaa9b39f0e9ddfa8c83725b3f230784976dd3c7f (diff)
downloadlinux-2b1eaa66352ac453b44451c230d8edd6c5a5ea80.tar.gz
linux-2b1eaa66352ac453b44451c230d8edd6c5a5ea80.tar.bz2
linux-2b1eaa66352ac453b44451c230d8edd6c5a5ea80.zip
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 <colin.king@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/emulex/benet/be_cmds.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c
index 02dd5246dfae..1a49297224ed 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
@@ -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)
{
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;
for (i = 0; i < num_entries; i++)