projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2b1eaa6
)
ipv6: use ARRAY_SIZE for array sizing calculation on array seg6_action_table
author
Colin Ian King
<colin.king@canonical.com>
Sun, 7 Jan 2018 23:50:26 +0000
(23:50 +0000)
committer
David S. Miller
<davem@davemloft.net>
Tue, 9 Jan 2018 16:40:46 +0000
(11:40 -0500)
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>
net/ipv6/seg6_local.c
patch
|
blob
|
blame
|
history
diff --git
a/net/ipv6/seg6_local.c
b/net/ipv6/seg6_local.c
index 825b8e01f94762c483f20e41218cdd26e83b4d50..ba3767ef5e93a7c3eed2263734ef7ef58c20d8cb 100644
(file)
--- a/
net/ipv6/seg6_local.c
+++ b/
net/ipv6/seg6_local.c
@@
-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)