qede: Decouple ethtool caps from qed

While the qed_lm_maps is closely tied with the QED_LM_* defines,
when iterating over the array use actual size instead of the qed
define to prevent future possible issues.

Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Mintz, Yuval 2016-10-31 07:14:24 +02:00 committed by David S. Miller
parent 14d39648cb
commit d7455f6e44
1 changed files with 2 additions and 2 deletions

View File

@ -320,7 +320,7 @@ static const struct qede_link_mode_mapping qed_lm_map[] = {
{ \
int i; \
\
for (i = 0; i < QED_LM_COUNT; i++) { \
for (i = 0; i < ARRAY_SIZE(qed_lm_map); i++) { \
if ((caps) & (qed_lm_map[i].qed_link_mode)) \
__set_bit(qed_lm_map[i].ethtool_link_mode,\
lk_ksettings->link_modes.name); \
@ -331,7 +331,7 @@ static const struct qede_link_mode_mapping qed_lm_map[] = {
{ \
int i; \
\
for (i = 0; i < QED_LM_COUNT; i++) { \
for (i = 0; i < ARRAY_SIZE(qed_lm_map); i++) { \
if (test_bit(qed_lm_map[i].ethtool_link_mode, \
lk_ksettings->link_modes.name)) \
caps |= qed_lm_map[i].qed_link_mode; \