1
0
Fork 0

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>
hifive-unleashed-5.1
zhong jiang 2018-08-03 14:53:15 +08:00 committed by David S. Miller
parent bf37afceaf
commit 31ba191bf5
1 changed files with 1 additions and 1 deletions

View File

@ -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;