Commit 3c72d4d3 authored by Jose Abreu's avatar Jose Abreu Committed by David S. Miller

net: stmmac: xgmac: Fix RSS not writing all Keys to HW

The sizeof(cfg->key) is != ARRAY_SIZE(cfg->key). Fix it. This warning is
triggered when running with cc flag -Wsizeof-array-div.
Reported-by: default avatarkbuild test robot <lkp@intel.com>
Reported-by: default avatarNick Desaulniers <ndesaulniers@google.com>
Reported-by: default avatarNathan Chancellor <natechancellor@gmail.com>
Fixes: 76067459 ("net: stmmac: Implement RSS and enable it in XGMAC core")
Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
Signed-off-by: default avatarJose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 30300d9f
...@@ -533,7 +533,7 @@ static int dwxgmac2_rss_configure(struct mac_device_info *hw, ...@@ -533,7 +533,7 @@ static int dwxgmac2_rss_configure(struct mac_device_info *hw,
return 0; return 0;
} }
for (i = 0; i < (sizeof(cfg->key) / sizeof(u32)); i++) { for (i = 0; i < (ARRAY_SIZE(cfg->key) / sizeof(u32)); i++) {
ret = dwxgmac2_rss_write_reg(ioaddr, true, i, cfg->key[i]); ret = dwxgmac2_rss_write_reg(ioaddr, true, i, cfg->key[i]);
if (ret) if (ret)
return ret; return ret;
......
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