Skip to content

Commit c05d145

Browse files
mosheshemesh2kuba-moo
authored andcommitted
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 <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent a57cc54 commit c05d145

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+1
-1
lines changed

drivers/net/ethernet/mellanox/mlx5/core/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ static int wait_fw_init(struct mlx5_core_dev *dev, u32 max_wait_mili,
191191
if (!(fw_initializing >> 31))
192192
break;
193193
if (time_after(jiffies, end) ||
194-
test_and_clear_bit(MLX5_BREAK_FW_WAIT, &dev->intf_state)) {
194+
test_bit(MLX5_BREAK_FW_WAIT, &dev->intf_state)) {
195195
err = -EBUSY;
196196
break;
197197
}

0 commit comments

Comments
 (0)