Skip to content

Commit

Permalink
ipv6: use ARRAY_SIZE for array sizing calculation on array seg6_actio…
Browse files Browse the repository at this point in the history
…n_table

Use the ARRAY_SIZE macro on array seg6_action_table 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>
  • Loading branch information
Colin Ian King authored and David S. Miller committed Jan 9, 2018
1 parent 2b1eaa6 commit 709af18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv6/seg6_local.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ static struct seg6_action_desc *__get_action_desc(int action)
struct seg6_action_desc *desc;
int i, count;

count = sizeof(seg6_action_table) / sizeof(struct seg6_action_desc);
count = ARRAY_SIZE(seg6_action_table);
for (i = 0; i < count; i++) {
desc = &seg6_action_table[i];
if (desc->action == action)
Expand Down

0 comments on commit 709af18

Please sign in to comment.