OSDN Git Service

net/mlx5: remove redundant clear_bit
authorMoshe Shemesh <moshe@nvidia.com>
Tue, 14 Mar 2023 05:42:20 +0000 (22:42 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 16 Mar 2023 05:09:13 +0000 (22:09 -0700)
commitc05d145abea138dbba213ce775820af73e893d92
treeb56f2de5a92cf9f783ac251a1821783c6387311b
parenta57cc54d69d601282c4451010b12f53630834203
net/mlx5: remove redundant clear_bit

When shutdown or remove callbacks are called the driver sets the flag
MLX5_BREAK_FW_WAIT, to stop waiting for FW as teardown was called. There
is no need to clear the bit as once shutdown or remove were called as
there is no way back, the driver is going down. Furthermore, if not
cleared the flag can be used also in other loops where we may wait while
teardown was already called.

Use test_bit() instead of test_and_clear_bit() as there is no need to
clear the flag.

Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Link: https://lore.kernel.org/r/20230314054234.267365-2-saeed@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/main.c