]> git.baikalelectronics.ru Git - 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)
commit2393481fa27b8b36483c9124ac3c079cfcf4d975
tree0c62077aee368e04ccd08a0bcae2c0f2f15d2e33
parentf86b179061b8ad0dc7c1e6bccf2326b90d899d2c
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