ACPI: remove unnecessary argument checking
authorBjorn Helgaas <bjorn.helgaas@hp.com>
Mon, 21 Sep 2009 19:29:30 +0000 (19:29 +0000)
committerLen Brown <len.brown@intel.com>
Fri, 25 Sep 2009 18:24:27 +0000 (14:24 -0400)
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 <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/scan.c

index 6c83342d13d575739a10642888e2a645d301b92d..f2e283426be98eab1357945700a7681d8f82e907 100644 (file)
@@ -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");