Commit d7455f6e authored by Mintz, Yuval's avatar Mintz, Yuval Committed by David S. Miller

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: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 14d39648
...@@ -320,7 +320,7 @@ static const struct qede_link_mode_mapping qed_lm_map[] = { ...@@ -320,7 +320,7 @@ static const struct qede_link_mode_mapping qed_lm_map[] = {
{ \ { \
int i; \ 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)) \ if ((caps) & (qed_lm_map[i].qed_link_mode)) \
__set_bit(qed_lm_map[i].ethtool_link_mode,\ __set_bit(qed_lm_map[i].ethtool_link_mode,\
lk_ksettings->link_modes.name); \ lk_ksettings->link_modes.name); \
...@@ -331,7 +331,7 @@ static const struct qede_link_mode_mapping qed_lm_map[] = { ...@@ -331,7 +331,7 @@ static const struct qede_link_mode_mapping qed_lm_map[] = {
{ \ { \
int i; \ 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, \ if (test_bit(qed_lm_map[i].ethtool_link_mode, \
lk_ksettings->link_modes.name)) \ lk_ksettings->link_modes.name)) \
caps |= qed_lm_map[i].qed_link_mode; \ caps |= qed_lm_map[i].qed_link_mode; \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment