From patchwork Wed Aug 24 23:17:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Utkin X-Patchwork-Id: 9298733 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E461460757 for ; Thu, 25 Aug 2016 06:38:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D54BD291D9 for ; Thu, 25 Aug 2016 06:38:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9BEF291DB; Thu, 25 Aug 2016 06:38:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 515B6291D9 for ; Thu, 25 Aug 2016 06:38:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757962AbcHYGiO (ORCPT ); Thu, 25 Aug 2016 02:38:14 -0400 Received: from mail-lf0-f42.google.com ([209.85.215.42]:36221 "EHLO mail-lf0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757076AbcHYGiM (ORCPT ); Thu, 25 Aug 2016 02:38:12 -0400 Received: by mail-lf0-f42.google.com with SMTP id g62so27486084lfe.3 for ; Wed, 24 Aug 2016 23:38:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corp-bluecherry-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=Da9yxUGllDFttr+fiZEg2yeazF1PlQucnnda/oPYWCQ=; b=us93rQGIcztoeiuEMaLNz8z5OH0TqCAYltBzMtVv1ltPZhUNX/YWliRsymkGts98eE ZFe32DNQIGYt36SP8Iduqo32jzccurEfESCtkxmps6bDGZmled62bDULYLGsgmwzUiS/ s4eJ39cXeX5tpuHC7rxfStSC5JAjte7cOJQ8Kgch/5YnY8kndeclu3irS48kbT2960F9 DYbT/1ZO6uVj8KzUvyiVZcokl6eOv1FCsWRfed6B1Id7xyTg3j5L4rIy9u4iS1GTHD+Q 8T2KrzPG2eQNXndfCTNxRxd01i7jUJ9RYdq+qd38N/VeRGAvXeweYmWocmFLB0uEZLjh sNKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Da9yxUGllDFttr+fiZEg2yeazF1PlQucnnda/oPYWCQ=; b=UCLtKmfPYN05VuDDKCov/ExSN1Ag8qZjfjTSFf2TSXDUU4X/YT3hoepbFZArknVo8D H/iuzhE9cs0TDeeglUX+jJYTTZtK5++tI3xRRnzrP21vAgMRV1sWQcYgf5zu+rOmQuM8 oGKuvhxpDLESJsFxW+yXyjJiYQhqNVW8kmQfgsr8cfCAfiaQS2SQXQUYOngjxRM9WadC FpkFa1oQInQ5zJ7OYucJ752ozigxTGhupVmTvV7YF8a6GRl5gqydkjKU36AFMMtRhHhP 9F2/D9IdOM1uSLoT1qa4Y4xKQzndXrk/jEX0fBYlth7ADKUZ51cYElCjih54FO1ueiEI YvyA== X-Gm-Message-State: AEkoousAy0mojaBqN0ysiwatbFqwLc+r/sAIsvRiOA3X2S3smQo1PH6c66wiciHt00PbKlwL X-Received: by 10.46.32.203 with SMTP id g72mr1458151lji.30.1472080776335; Wed, 24 Aug 2016 16:19:36 -0700 (PDT) Received: from localhost.localdomain ([195.78.246.16]) by smtp.gmail.com with ESMTPSA id l19sm2433712lfi.24.2016.08.24.16.19.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Aug 2016 16:19:35 -0700 (PDT) From: Andrey Utkin To: Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Bluecherry Maintainers , Andrey Utkin , Andrey Utkin Subject: [PATCH] [media] tw5864-core: remove excessive irqsave Date: Thu, 25 Aug 2016 02:17:18 +0300 Message-Id: <20160824231718.25032-1-andrey.utkin@corp.bluecherry.net> X-Mailer: git-send-email 2.9.2 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Andrey Utkin --- 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",