From patchwork Fri Jan 9 09:26:42 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Len Brown X-Patchwork-Id: 1486 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n099NxNl003124 for ; Fri, 9 Jan 2009 01:24:41 -0800 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753721AbZAIJ2X (ORCPT ); Fri, 9 Jan 2009 04:28:23 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753680AbZAIJ2W (ORCPT ); Fri, 9 Jan 2009 04:28:22 -0500 Received: from vms173007pub.verizon.net ([206.46.173.7]:56372 "EHLO vms173007pub.verizon.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753430AbZAIJ2J (ORCPT ); Fri, 9 Jan 2009 04:28:09 -0500 Received: from localhost.localdomain ([96.237.168.40]) by vms173007.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0KD700G5G68JXTH5@vms173007.mailsrvcs.net> for linux-acpi@vger.kernel.org; Fri, 09 Jan 2009 03:26:44 -0600 (CST) Received: from localhost.localdomain (d975xbx2 [127.0.0.1]) by localhost.localdomain (8.14.2/8.14.2) with ESMTP id n099S6qd011959; Fri, 09 Jan 2009 04:28:06 -0500 Received: (from lenb@localhost) by localhost.localdomain (8.14.2/8.14.2/Submit) id n099S6IT011958; Fri, 09 Jan 2009 04:28:06 -0500 Date: Fri, 09 Jan 2009 04:26:42 -0500 From: Len Brown Subject: [PATCH 40/94] ACPI: PCI: remove unnecessary null pointer checks In-reply-to: <1231493256-11678-1-git-send-email-lenb@kernel.org> In-reply-to: To: linux-acpi@vger.kernel.org Cc: Bjorn Helgaas , Len Brown Message-id: <3b8249de43ecf05407888c1ca6ca6e4945ff823c.1231492609.git.len.brown@intel.com> Organization: Intel Open Source Technology Center X-Mailer: git-send-email 1.6.1.76.gc123b References: <1231493256-11678-1-git-send-email-lenb@kernel.org> References: Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Bjorn Helgaas Better to oops and learn about a bug than to silently cover it up. Signed-off-by: Bjorn Helgaas Signed-off-by: Len Brown --- drivers/acpi/pci_irq.c | 18 ------------------ 1 files changed, 0 insertions(+), 18 deletions(-) diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index 63a1326..6c04060 100644 --- a/drivers/acpi/pci_irq.c +++ b/drivers/acpi/pci_irq.c @@ -178,10 +178,6 @@ acpi_pci_irq_add_entry(acpi_handle handle, { struct acpi_prt_entry *entry = NULL; - - if (!prt) - return -EINVAL; - entry = kzalloc(sizeof(struct acpi_prt_entry), GFP_KERNEL); if (!entry) return -ENOMEM; @@ -432,9 +428,6 @@ acpi_pci_irq_derive(struct pci_dev *dev, u8 bridge_pin = 0, orig_pin = pin; - if (!dev) - return -EINVAL; - /* * Attempt to derive an IRQ for this device from a parent bridge's * PCI interrupt routing entry (eg. yenta bridge and add-in card bridge). @@ -491,9 +484,6 @@ int acpi_pci_irq_enable(struct pci_dev *dev) int rc; - if (!dev) - return -EINVAL; - pin = dev->pin; if (!pin) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, @@ -503,11 +493,6 @@ int acpi_pci_irq_enable(struct pci_dev *dev) } pin--; - if (!dev->bus) { - dev_err(&dev->dev, "invalid (NULL) 'bus' field\n"); - return -ENODEV; - } - /* * First we check the PCI IRQ routing table (PRT) for an IRQ. PRT * values override any BIOS-assigned IRQs set during boot. @@ -586,9 +571,6 @@ void acpi_pci_irq_disable(struct pci_dev *dev) int polarity = ACPI_ACTIVE_LOW; - if (!dev || !dev->bus) - return; - pin = dev->pin; if (!pin) return;