From: zhong jiang Date: Fri, 3 Aug 2018 06:53:15 +0000 (+0800) Subject: include/net/bond_3ad: Simplify the code by using the ARRAY_SIZE X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=31ba191bf5ab2975c1955f1adf771a5a0b57afaa;p=linux.git 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 Signed-off-by: David S. Miller --- diff --git a/include/net/bond_3ad.h b/include/net/bond_3ad.h index f358ad5e42145..fc3111515f5cb 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) "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;