Commit 12dd6d86 authored by Rajesh Borundia's avatar Rajesh Borundia Committed by Greg Kroah-Hartman

qlcnic: Remove unnecessary usage of atomic_t

[ Upstream commit 5bf93251 ]

o atomic_t usage is incorrect as we are not implementing
any atomicity.
Signed-off-by: default avatarRajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8352a292
...@@ -1099,7 +1099,7 @@ struct qlcnic_mailbox { ...@@ -1099,7 +1099,7 @@ struct qlcnic_mailbox {
unsigned long status; unsigned long status;
spinlock_t queue_lock; /* Mailbox queue lock */ spinlock_t queue_lock; /* Mailbox queue lock */
spinlock_t aen_lock; /* Mailbox response/AEN lock */ spinlock_t aen_lock; /* Mailbox response/AEN lock */
atomic_t rsp_status; u32 rsp_status;
u32 num_cmds; u32 num_cmds;
}; };
......
...@@ -491,7 +491,7 @@ irqreturn_t qlcnic_83xx_clear_legacy_intr(struct qlcnic_adapter *adapter) ...@@ -491,7 +491,7 @@ irqreturn_t qlcnic_83xx_clear_legacy_intr(struct qlcnic_adapter *adapter)
static inline void qlcnic_83xx_notify_mbx_response(struct qlcnic_mailbox *mbx) static inline void qlcnic_83xx_notify_mbx_response(struct qlcnic_mailbox *mbx)
{ {
atomic_set(&mbx->rsp_status, QLC_83XX_MBX_RESPONSE_ARRIVED); mbx->rsp_status = QLC_83XX_MBX_RESPONSE_ARRIVED;
complete(&mbx->completion); complete(&mbx->completion);
} }
...@@ -510,7 +510,7 @@ static void qlcnic_83xx_poll_process_aen(struct qlcnic_adapter *adapter) ...@@ -510,7 +510,7 @@ static void qlcnic_83xx_poll_process_aen(struct qlcnic_adapter *adapter)
if (event & QLCNIC_MBX_ASYNC_EVENT) { if (event & QLCNIC_MBX_ASYNC_EVENT) {
__qlcnic_83xx_process_aen(adapter); __qlcnic_83xx_process_aen(adapter);
} else { } else {
if (atomic_read(&mbx->rsp_status) != rsp_status) if (mbx->rsp_status != rsp_status)
qlcnic_83xx_notify_mbx_response(mbx); qlcnic_83xx_notify_mbx_response(mbx);
} }
out: out:
...@@ -1023,7 +1023,7 @@ static void qlcnic_83xx_process_aen(struct qlcnic_adapter *adapter) ...@@ -1023,7 +1023,7 @@ static void qlcnic_83xx_process_aen(struct qlcnic_adapter *adapter)
if (event & QLCNIC_MBX_ASYNC_EVENT) { if (event & QLCNIC_MBX_ASYNC_EVENT) {
__qlcnic_83xx_process_aen(adapter); __qlcnic_83xx_process_aen(adapter);
} else { } else {
if (atomic_read(&mbx->rsp_status) != rsp_status) if (mbx->rsp_status != rsp_status)
qlcnic_83xx_notify_mbx_response(mbx); qlcnic_83xx_notify_mbx_response(mbx);
} }
} }
...@@ -4050,7 +4050,6 @@ static void qlcnic_83xx_mailbox_worker(struct work_struct *work) ...@@ -4050,7 +4050,6 @@ static void qlcnic_83xx_mailbox_worker(struct work_struct *work)
struct qlcnic_adapter *adapter = mbx->adapter; struct qlcnic_adapter *adapter = mbx->adapter;
const struct qlcnic_mbx_ops *mbx_ops = mbx->ops; const struct qlcnic_mbx_ops *mbx_ops = mbx->ops;
struct device *dev = &adapter->pdev->dev; struct device *dev = &adapter->pdev->dev;
atomic_t *rsp_status = &mbx->rsp_status;
struct list_head *head = &mbx->cmd_q; struct list_head *head = &mbx->cmd_q;
struct qlcnic_hardware_context *ahw; struct qlcnic_hardware_context *ahw;
struct qlcnic_cmd_args *cmd = NULL; struct qlcnic_cmd_args *cmd = NULL;
...@@ -4063,7 +4062,7 @@ static void qlcnic_83xx_mailbox_worker(struct work_struct *work) ...@@ -4063,7 +4062,7 @@ static void qlcnic_83xx_mailbox_worker(struct work_struct *work)
return; return;
} }
atomic_set(rsp_status, QLC_83XX_MBX_RESPONSE_WAIT); mbx->rsp_status = QLC_83XX_MBX_RESPONSE_WAIT;
spin_lock(&mbx->queue_lock); spin_lock(&mbx->queue_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment