mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daode Huang <huangdaode@huawei.com>
To: <sean@mess.org>, <mchehab@kernel.org>
Cc: <linux-media@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<song.bao.hua@hisilicon.com>
Subject: [PATCH] media: rc/ite-cir: replace spin_lock_irqsave by spin_lock in hard IRQ
Date: Fri, 5 Feb 2021 17:39:11 +0800	[thread overview]
Message-ID: <1612517951-119798-1-git-send-email-huangdaode@huawei.com> (raw)

It is redundant to do irqsave and irqrestore in hardIRQ context.

Signed-off-by: Daode Huang <huangdaode@huawei.com>
---
 drivers/media/rc/ite-cir.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c
index 0c62295..4a51ca80 100644
--- a/drivers/media/rc/ite-cir.c
+++ b/drivers/media/rc/ite-cir.c
@@ -262,7 +262,6 @@ static void ite_set_carrier_params(struct ite_dev *dev)
 static irqreturn_t ite_cir_isr(int irq, void *data)
 {
 	struct ite_dev *dev = data;
-	unsigned long flags;
 	irqreturn_t ret = IRQ_RETVAL(IRQ_NONE);
 	u8 rx_buf[ITE_RX_FIFO_LEN];
 	int rx_bytes;
@@ -271,7 +270,7 @@ static irqreturn_t ite_cir_isr(int irq, void *data)
 	ite_dbg_verbose("%s firing", __func__);
 
 	/* grab the spinlock */
-	spin_lock_irqsave(&dev->lock, flags);
+	spin_lock(&dev->lock);
 
 	/* read the interrupt flags */
 	iflags = dev->params.get_irq_causes(dev);
@@ -287,17 +286,14 @@ static irqreturn_t ite_cir_isr(int irq, void *data)
 			/* drop the spinlock, since the ir-core layer
 			 * may call us back again through
 			 * ite_s_idle() */
-			spin_unlock_irqrestore(&dev->
-									 lock,
-									 flags);
+			spin_unlock(&dev->lock);
 
 			/* decode the data we've just received */
 			ite_decode_bytes(dev, rx_buf,
 								   rx_bytes);
 
 			/* reacquire the spinlock */
-			spin_lock_irqsave(&dev->lock,
-								    flags);
+			spin_lock(&dev->lock);
 
 			/* mark the interrupt as serviced */
 			ret = IRQ_RETVAL(IRQ_HANDLED);
@@ -314,7 +310,7 @@ static irqreturn_t ite_cir_isr(int irq, void *data)
 	}
 
 	/* drop the spinlock */
-	spin_unlock_irqrestore(&dev->lock, flags);
+	spin_unlock(&dev->lock);
 
 	ite_dbg_verbose("%s done returning %d", __func__, (int)ret);
 
-- 
2.8.1


                 reply	other threads:[~2021-02-05  9:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1612517951-119798-1-git-send-email-huangdaode@huawei.com \
    --to=huangdaode@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sean@mess.org \
    --cc=song.bao.hua@hisilicon.com \
    /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

all inboxes | Powered by JetHome®