From patchwork Fri Jul 31 21:37:29 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 38605 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 n6VLbBID017264 for ; Fri, 31 Jul 2009 21:37:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753179AbZGaVha (ORCPT ); Fri, 31 Jul 2009 17:37:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753004AbZGaVha (ORCPT ); Fri, 31 Jul 2009 17:37:30 -0400 Received: from g5t0008.atlanta.hp.com ([15.192.0.45]:17895 "EHLO g5t0008.atlanta.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752860AbZGaVha (ORCPT ); Fri, 31 Jul 2009 17:37:30 -0400 Received: from g4t0018.houston.hp.com (g4t0018.houston.hp.com [16.234.32.27]) by g5t0008.atlanta.hp.com (Postfix) with ESMTP id 0B17424415; Fri, 31 Jul 2009 21:37:30 +0000 (UTC) Received: from ldl.fc.hp.com (ldl.fc.hp.com [15.11.146.30]) by g4t0018.houston.hp.com (Postfix) with ESMTP id C66C71005E; Fri, 31 Jul 2009 21:37:30 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl.fc.hp.com (Postfix) with ESMTP id 931E339C003; Fri, 31 Jul 2009 15:37:30 -0600 (MDT) X-Virus-Scanned: Debian amavisd-new at ldl.fc.hp.com Received: from ldl.fc.hp.com ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DCWfl8qyBCBl; Fri, 31 Jul 2009 15:37:29 -0600 (MDT) Received: from eh.fc.hp.com (eh.fc.hp.com [15.11.146.105]) by ldl.fc.hp.com (Postfix) with ESMTP id 8FB3839C009; Fri, 31 Jul 2009 15:37:29 -0600 (MDT) Received: from bob.kio (localhost [127.0.0.1]) by eh.fc.hp.com (Postfix) with ESMTP id 81F3226169; Fri, 31 Jul 2009 15:37:29 -0600 (MDT) Subject: [PATCH 11/19] ACPI: remove unnecessary argument checking To: Len Brown From: Bjorn Helgaas Cc: linux-acpi@vger.kernel.org Date: Fri, 31 Jul 2009 15:37:29 -0600 Message-ID: <20090731213729.29930.92220.stgit@bob.kio> In-Reply-To: <20090731213501.29930.39957.stgit@bob.kio> References: <20090731213501.29930.39957.stgit@bob.kio> User-Agent: StGit/0.14.3.386.gb02d MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org acpi_add_single_object() is static, and all callers supply a valid "child" argument, so we don't need to check it. This patch also remove some unnecessary initializations. Signed-off-by: Bjorn Helgaas --- drivers/acpi/scan.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 7623a80..35ea4c2 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -1170,14 +1170,10 @@ acpi_add_single_object(struct acpi_device **child, struct acpi_device *parent, acpi_handle handle, int type, struct acpi_bus_ops *ops) { - int result = 0; - struct acpi_device *device = NULL; + int result; + struct acpi_device *device; struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; - - if (!child) - return -EINVAL; - device = kzalloc(sizeof(struct acpi_device), GFP_KERNEL); if (!device) { printk(KERN_ERR PREFIX "Memory allocation error\n");