From patchwork Thu Sep 26 14:11:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Veaceslav Falico X-Patchwork-Id: 2948391 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A7B1E9F244 for ; Thu, 26 Sep 2013 14:11:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 167B420333 for ; Thu, 26 Sep 2013 14:11:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C00F92022A for ; Thu, 26 Sep 2013 14:11:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751259Ab3IZOLH (ORCPT ); Thu, 26 Sep 2013 10:11:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58185 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750966Ab3IZOLG (ORCPT ); Thu, 26 Sep 2013 10:11:06 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8QEAsuN009507 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 26 Sep 2013 10:10:54 -0400 Received: from darkmag.usersys.redhat.com (dhcp-27-102.brq.redhat.com [10.34.27.102]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r8QEAmkM008125; Thu, 26 Sep 2013 10:10:52 -0400 From: Veaceslav Falico To: linux-pci@vger.kernel.org Cc: Veaceslav Falico , Bjorn Helgaas , Neil Horman , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] msi: remove useless kobject_del() in free_msi_irqs() Date: Thu, 26 Sep 2013 16:11:15 +0200 Message-Id: <1380204675-18238-3-git-send-email-vfalico@redhat.com> In-Reply-To: <1380204675-18238-1-git-send-email-vfalico@redhat.com> References: <1380204675-18238-1-git-send-email-vfalico@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-9.3 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 We only need to kobject_put() on removal (which will, eventually, call kobject_del()). kobject_del() should be implicitly used only on circular references (per documentation), however it's not the case here. CC: Bjorn Helgaas CC: Neil Horman CC: Greg Kroah-Hartman CC: linux-pci@vger.kernel.org CC: linux-kernel@vger.kernel.org Signed-off-by: Veaceslav Falico --- drivers/pci/msi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index dafda2b..d62c468 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -384,12 +384,10 @@ static void free_msi_irqs(struct pci_dev *dev) * kobject->release will take care of freeing the entry via * msi_kobj_release(). */ - if (entry->kobj.parent) { - kobject_del(&entry->kobj); + if (entry->kobj.parent) kobject_put(&entry->kobj); - } else { + else kfree(entry); - } } if (dev->msi_kset) {