From: Wei Yongjun <weiyj.lk@gmail.com>
To: Yuval Mintz <Yuval.Mintz@qlogic.com>,
Ariel Elior <Ariel.Elior@qlogic.com>
Cc: Wei Yongjun <weiyj.lk@gmail.com>,
everest-linux-l2@qlogic.com, netdev@vger.kernel.org
Subject: [PATCH -next] qed: Use DEFINE_SPINLOCK() for spinlock
Date: Tue, 2 Aug 2016 13:49:00 +0000 [thread overview]
Message-ID: <1470145740-17392-1-git-send-email-weiyj.lk@gmail.com> (raw)
spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().
Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
---
drivers/net/ethernet/qlogic/qed/qed_dev.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qed/qed_dev.c b/drivers/net/ethernet/qlogic/qed/qed_dev.c
index 0b47ab5..cc623d2 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dev.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dev.c
@@ -35,8 +35,7 @@
#include "qed_sriov.h"
#include "qed_vf.h"
-static spinlock_t qm_lock;
-static bool qm_lock_init = false;
+static DEFINE_SPINLOCK(qm_lock);
/* API common to all protocols */
enum BAR_ID {
@@ -1003,11 +1002,6 @@ int qed_hw_init(struct qed_dev *cdev,
p_hwfn->first_on_engine = (load_code ==
FW_MSG_CODE_DRV_LOAD_ENGINE);
- if (!qm_lock_init) {
- spin_lock_init(&qm_lock);
- qm_lock_init = true;
- }
-
switch (load_code) {
case FW_MSG_CODE_DRV_LOAD_ENGINE:
rc = qed_hw_init_common(p_hwfn, p_hwfn->p_main_ptt,
next reply other threads:[~2016-08-02 13:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-02 13:49 Wei Yongjun [this message]
2016-08-02 14:04 ` [PATCH -next] qed: Use DEFINE_SPINLOCK() for spinlock Yuval Mintz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1470145740-17392-1-git-send-email-weiyj.lk@gmail.com \
--to=weiyj.lk@gmail.com \
--cc=Ariel.Elior@qlogic.com \
--cc=Yuval.Mintz@qlogic.com \
--cc=everest-linux-l2@qlogic.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox