diff options
author | zhong jiang <zhongjiang@huawei.com> | 2018-08-03 02:53:15 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-08-04 16:23:15 -0400 |
commit | 31ba191bf5ab2975c1955f1adf771a5a0b57afaa (patch) | |
tree | 1d5dc4ec0499658034e155b0e1d6b1b8d07ff6e9 | |
parent | bf37afceaf549ce9ef50e3042f64d257a3d4be80 (diff) |
include/net/bond_3ad: Simplify the code by using the ARRAY_SIZE
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>
-rw-r--r-- | include/net/bond_3ad.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/bond_3ad.h b/include/net/bond_3ad.h index f358ad5e4214..fc3111515f5c 100644 --- 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) | |||
283 | "none", | 283 | "none", |
284 | "unknown" | 284 | "unknown" |
285 | }; | 285 | }; |
286 | int max_size = sizeof(churn_description) / sizeof(churn_description[0]); | 286 | int max_size = ARRAY_SIZE(churn_description); |
287 | 287 | ||
288 | if (state >= max_size) | 288 | if (state >= max_size) |
289 | state = max_size - 1; | 289 | state = max_size - 1; |