From patchwork Sat Nov 21 11:16:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 7674131 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 446AC9F1C2 for ; Sat, 21 Nov 2015 11:17:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 76E242056E for ; Sat, 21 Nov 2015 11:17:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 38F9E2052F for ; Sat, 21 Nov 2015 11:17:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751600AbbKULQr (ORCPT ); Sat, 21 Nov 2015 06:16:47 -0500 Received: from smtp-out-098.synserver.de ([212.40.185.98]:1072 "EHLO smtp-out-188.synserver.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751297AbbKULQq (ORCPT ); Sat, 21 Nov 2015 06:16:46 -0500 Received: (qmail 17313 invoked by uid 0); 21 Nov 2015 11:16:45 -0000 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 17017 Received: from ppp-188-174-124-62.dynamic.mnet-online.de (HELO lars-laptop.fritz.box) [188.174.124.62] by 217.119.54.96 with SMTP; 21 Nov 2015 11:16:45 -0000 From: Lars-Peter Clausen To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, Lars-Peter Clausen Subject: [PATCH] [media] dm1105: Remove unnecessary synchronize_irq() before free_irq() Date: Sat, 21 Nov 2015 12:16:38 +0100 Message-Id: <1448104598-23513-1-git-send-email-lars@metafoo.de> X-Mailer: git-send-email 2.1.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Calling synchronize_irq() right before free_irq() is quite useless. On one hand the IRQ can easily fire again before free_irq() is entered, on the other hand free_irq() itself calls synchronize_irq() internally (in a race condition free way), before any state associated with the IRQ is freed. Patch was generated using the following semantic patch: // @@ expression irq; @@ -synchronize_irq(irq); free_irq(irq, ...); // Signed-off-by: Lars-Peter Clausen --- drivers/media/pci/dm1105/dm1105.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/pci/dm1105/dm1105.c b/drivers/media/pci/dm1105/dm1105.c index 88915fb..5dd5047 100644 --- a/drivers/media/pci/dm1105/dm1105.c +++ b/drivers/media/pci/dm1105/dm1105.c @@ -1206,7 +1206,6 @@ static void dm1105_remove(struct pci_dev *pdev) i2c_del_adapter(&dev->i2c_adap); dm1105_hw_exit(dev); - synchronize_irq(pdev->irq); free_irq(pdev->irq, dev); pci_iounmap(pdev, dev->io_mem); pci_release_regions(pdev);