Skip to content

Commit

Permalink
include/net/bond_3ad: Simplify the code by using the ARRAY_SIZE
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
xiongzhongjiang authored and davem330 committed Aug 4, 2018
1 parent bf37afc commit 31ba191
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/net/bond_3ad.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 31ba191

Please sign in to comment.