projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bf37afc
)
include/net/bond_3ad: Simplify the code by using the ARRAY_SIZE
author
zhong jiang
<zhongjiang@huawei.com>
Fri, 3 Aug 2018 06:53:15 +0000
(14:53 +0800)
committer
David S. Miller
<davem@davemloft.net>
Sat, 4 Aug 2018 20:23:15 +0000
(13:23 -0700)
We prefer to ARRAY_SIZE rather than the open code to calculate size.
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/bond_3ad.h
patch
|
blob
|
history
diff --git
a/include/net/bond_3ad.h
b/include/net/bond_3ad.h
index
f358ad5
..
fc31115
100644
(file)
--- a/
include/net/bond_3ad.h
+++ b/
include/net/bond_3ad.h
@@
-283,7
+283,7
@@
static inline const char *bond_3ad_churn_desc(churn_state_t state)
"none",
"unknown"
};
- int max_size =
sizeof(churn_description) / sizeof(churn_description[0]
);
+ int max_size =
ARRAY_SIZE(churn_description
);
if (state >= max_size)
state = max_size - 1;