Skip to content

Commit 5bf9325

Browse files
Rajesh Borundiadavem330
authored andcommitted
qlcnic: Remove unnecessary usage of atomic_t
o atomic_t usage is incorrect as we are not implementing any atomicity. Signed-off-by: Rajesh Borundia <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b795a21 commit 5bf9325

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

drivers/net/ethernet/qlogic/qlcnic/qlcnic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,7 @@ struct qlcnic_mailbox {
10991099
unsigned long status;
11001100
spinlock_t queue_lock; /* Mailbox queue lock */
11011101
spinlock_t aen_lock; /* Mailbox response/AEN lock */
1102-
atomic_t rsp_status;
1102+
u32 rsp_status;
11031103
u32 num_cmds;
11041104
};
11051105

drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ irqreturn_t qlcnic_83xx_clear_legacy_intr(struct qlcnic_adapter *adapter)
491491

492492
static inline void qlcnic_83xx_notify_mbx_response(struct qlcnic_mailbox *mbx)
493493
{
494-
atomic_set(&mbx->rsp_status, QLC_83XX_MBX_RESPONSE_ARRIVED);
494+
mbx->rsp_status = QLC_83XX_MBX_RESPONSE_ARRIVED;
495495
complete(&mbx->completion);
496496
}
497497

@@ -510,7 +510,7 @@ static void qlcnic_83xx_poll_process_aen(struct qlcnic_adapter *adapter)
510510
if (event & QLCNIC_MBX_ASYNC_EVENT) {
511511
__qlcnic_83xx_process_aen(adapter);
512512
} else {
513-
if (atomic_read(&mbx->rsp_status) != rsp_status)
513+
if (mbx->rsp_status != rsp_status)
514514
qlcnic_83xx_notify_mbx_response(mbx);
515515
}
516516
out:
@@ -1023,7 +1023,7 @@ static void qlcnic_83xx_process_aen(struct qlcnic_adapter *adapter)
10231023
if (event & QLCNIC_MBX_ASYNC_EVENT) {
10241024
__qlcnic_83xx_process_aen(adapter);
10251025
} else {
1026-
if (atomic_read(&mbx->rsp_status) != rsp_status)
1026+
if (mbx->rsp_status != rsp_status)
10271027
qlcnic_83xx_notify_mbx_response(mbx);
10281028
}
10291029
}
@@ -4050,7 +4050,6 @@ static void qlcnic_83xx_mailbox_worker(struct work_struct *work)
40504050
struct qlcnic_adapter *adapter = mbx->adapter;
40514051
const struct qlcnic_mbx_ops *mbx_ops = mbx->ops;
40524052
struct device *dev = &adapter->pdev->dev;
4053-
atomic_t *rsp_status = &mbx->rsp_status;
40544053
struct list_head *head = &mbx->cmd_q;
40554054
struct qlcnic_hardware_context *ahw;
40564055
struct qlcnic_cmd_args *cmd = NULL;
@@ -4063,7 +4062,7 @@ static void qlcnic_83xx_mailbox_worker(struct work_struct *work)
40634062
return;
40644063
}
40654064

4066-
atomic_set(rsp_status, QLC_83XX_MBX_RESPONSE_WAIT);
4065+
mbx->rsp_status = QLC_83XX_MBX_RESPONSE_WAIT;
40674066

40684067
spin_lock(&mbx->queue_lock);
40694068

0 commit comments

Comments
 (0)