From patchwork Mon Sep 21 19:29:30 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 49098 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 n8LJSloZ009091 for ; Mon, 21 Sep 2009 19:29:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753366AbZIUT31 (ORCPT ); Mon, 21 Sep 2009 15:29:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753369AbZIUT31 (ORCPT ); Mon, 21 Sep 2009 15:29:27 -0400 Received: from g5t0008.atlanta.hp.com ([15.192.0.45]:47507 "EHLO g5t0008.atlanta.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753366AbZIUT30 (ORCPT ); Mon, 21 Sep 2009 15:29:26 -0400 Received: from g1t0038.austin.hp.com (g1t0038.austin.hp.com [16.236.32.44]) by g5t0008.atlanta.hp.com (Postfix) with ESMTP id E0D3D24417; Mon, 21 Sep 2009 19:29:30 +0000 (UTC) Received: from ldl (linux.corp.hp.com [15.11.146.101]) by g1t0038.austin.hp.com (Postfix) with ESMTP id B41493014F; Mon, 21 Sep 2009 19:29:30 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl (Postfix) with ESMTP id BD3B0CF000E; Mon, 21 Sep 2009 13:29:30 -0600 (MDT) Received: from ldl ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KFLI3AV0V6ZE; Mon, 21 Sep 2009 13:29:30 -0600 (MDT) Received: from eh.fc.hp.com (eh.fc.hp.com [15.11.146.105]) by ldl (Postfix) with ESMTP id AAA96CF000D; Mon, 21 Sep 2009 13:29:30 -0600 (MDT) Received: from bob.kio (localhost [127.0.0.1]) by eh.fc.hp.com (Postfix) with ESMTP id 7D0962615C; Mon, 21 Sep 2009 13:29:30 -0600 (MDT) Subject: [PATCH v3 09/17] ACPI: remove unnecessary argument checking To: Len Brown From: Bjorn Helgaas Cc: linux-acpi@vger.kernel.org Date: Mon, 21 Sep 2009 13:29:30 -0600 Message-ID: <20090921192930.21322.77815.stgit@bob.kio> In-Reply-To: <20090921192656.21322.23072.stgit@bob.kio> References: <20090921192656.21322.23072.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 6c83342..f2e2834 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -1222,14 +1222,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");