Commit 0898ca67 authored by Ansuel Smith's avatar Ansuel Smith Committed by Jakub Kicinski

net: dsa: qca8k: fix warning in LAG feature

Fix warning reported by bot.
Make sure hash is init to 0 and fix wrong logic for hash_type in
qca8k_lag_can_offload.
Reported-by: default avatarkernel test robot <lkp@intel.com>
Fixes: def97530 ("net: dsa: qca8k: add LAG support")
Signed-off-by: default avatarAnsuel Smith <ansuelsmth@gmail.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20211123154446.31019-1-ansuelsmth@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent e670e1e8
...@@ -2228,7 +2228,7 @@ qca8k_lag_can_offload(struct dsa_switch *ds, ...@@ -2228,7 +2228,7 @@ qca8k_lag_can_offload(struct dsa_switch *ds,
if (info->tx_type != NETDEV_LAG_TX_TYPE_HASH) if (info->tx_type != NETDEV_LAG_TX_TYPE_HASH)
return false; return false;
if (info->hash_type != NETDEV_LAG_HASH_L2 || if (info->hash_type != NETDEV_LAG_HASH_L2 &&
info->hash_type != NETDEV_LAG_HASH_L23) info->hash_type != NETDEV_LAG_HASH_L23)
return false; return false;
...@@ -2242,8 +2242,8 @@ qca8k_lag_setup_hash(struct dsa_switch *ds, ...@@ -2242,8 +2242,8 @@ qca8k_lag_setup_hash(struct dsa_switch *ds,
{ {
struct qca8k_priv *priv = ds->priv; struct qca8k_priv *priv = ds->priv;
bool unique_lag = true; bool unique_lag = true;
u32 hash = 0;
int i, id; int i, id;
u32 hash;
id = dsa_lag_id(ds->dst, lag); id = dsa_lag_id(ds->dst, lag);
......
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