Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1469796 > unrolled thread

[PATCH] [media] tw5864-core: remove excessive irqsave

Started byAndrey Utkin <andrey.utkin@corp.bluecherry.net>
First post2016-08-25 01:30 +0200
Last post2016-08-25 01:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] [media] tw5864-core: remove excessive irqsave Andrey Utkin <andrey.utkin@corp.bluecherry.net> - 2016-08-25 01:30 +0200

#1469796 — [PATCH] [media] tw5864-core: remove excessive irqsave

FromAndrey Utkin <andrey.utkin@corp.bluecherry.net>
Date2016-08-25 01:30 +0200
Subject[PATCH] [media] tw5864-core: remove excessive irqsave
Message-ID<s9PMn-17y-51@gated-at.bofh.it>
As warned by smatch:
	drivers/media/pci/tw5864/tw5864-core.c:160 tw5864_h264_isr() error: double lock 'irqsave:flags'
	drivers/media/pci/tw5864/tw5864-core.c:174 tw5864_h264_isr() error: double unlock 'irqsave:flags'

Two different spinlocks are obtained, so having two calls is correct,
but second irqsave is superfluous, and using same "flags" variable is
just wrong.

Reported-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Andrey Utkin <andrey.utkin@corp.bluecherry.net>
---
 drivers/media/pci/tw5864/tw5864-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/pci/tw5864/tw5864-core.c b/drivers/media/pci/tw5864/tw5864-core.c
index 440cd7b..1d43b96 100644
--- a/drivers/media/pci/tw5864/tw5864-core.c
+++ b/drivers/media/pci/tw5864/tw5864-core.c
@@ -157,12 +157,12 @@ static void tw5864_h264_isr(struct tw5864_dev *dev)
 
 		cur_frame = next_frame;
 
-		spin_lock_irqsave(&input->slock, flags);
+		spin_lock(&input->slock);
 		input->frame_seqno++;
 		input->frame_gop_seqno++;
 		if (input->frame_gop_seqno >= input->gop)
 			input->frame_gop_seqno = 0;
-		spin_unlock_irqrestore(&input->slock, flags);
+		spin_unlock(&input->slock);
 	} else {
 		dev_err(&dev->pci->dev,
 			"Skipped frame on input %d because all buffers busy\n",
-- 
2.9.2

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web