Skip to content

Commit 709af18

Browse files
Colin Ian Kingdavem330
authored andcommitted
ipv6: use ARRAY_SIZE for array sizing calculation on array seg6_action_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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2b1eaa6 commit 709af18

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv6/seg6_local.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ static struct seg6_action_desc *__get_action_desc(int action)
501501
struct seg6_action_desc *desc;
502502
int i, count;
503503

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

0 commit comments

Comments
 (0)