]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[media] tw5864-core: remove excessive irqsave
authorAndrey Utkin <andrey.utkin@corp.bluecherry.net>
Wed, 24 Aug 2016 23:17:18 +0000 (20:17 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 6 Sep 2016 19:45:48 +0000 (16:45 -0300)
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>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/pci/tw5864/tw5864-core.c

index 440cd7bb8d04d173c9c205ee555660801177b31a..1d43b96958ea742ee040f39a83a3c2a28547af43 100644 (file)
@@ -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",