]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
mlxsw: spectrum_qdisc: Simplify mlxsw_sp_qdisc_compare()
authorPetr Machata <petrm@nvidia.com>
Tue, 20 Apr 2021 14:53:40 +0000 (16:53 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Apr 2021 23:43:13 +0000 (16:43 -0700)
commit290fe2c595fbf9b9099a93528d6f85d3d7d21fa4
tree0c62077aee368e04ccd08a0bcae2c0f2f15d2e33
parent17c0e6d1757f01ce54c7dee19396053d721ca006
mlxsw: spectrum_qdisc: Simplify mlxsw_sp_qdisc_compare()

The purpose of this function is to filter out events that are related to
qdiscs that are not offloaded, or are not offloaded anymore. But the
function is unnecessarily thorough:

- mlxsw_sp_qdisc pointer is never NULL in the context where it is called
- Two qdiscs with the same handle will never have different types. Even
  when replacing one qdisc with another in the same class, Linux will not
  permit handle reuse unless the qdisc type also matches.

Simplify the function by omitting these two unnecessary conditions.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c