Commit 77c24888 authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Len Brown

ACPI: remove unnecessary argument checking

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: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent c7bcb4e9
...@@ -1222,14 +1222,10 @@ acpi_add_single_object(struct acpi_device **child, ...@@ -1222,14 +1222,10 @@ acpi_add_single_object(struct acpi_device **child,
struct acpi_device *parent, acpi_handle handle, int type, struct acpi_device *parent, acpi_handle handle, int type,
struct acpi_bus_ops *ops) struct acpi_bus_ops *ops)
{ {
int result = 0; int result;
struct acpi_device *device = NULL; struct acpi_device *device;
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
if (!child)
return -EINVAL;
device = kzalloc(sizeof(struct acpi_device), GFP_KERNEL); device = kzalloc(sizeof(struct acpi_device), GFP_KERNEL);
if (!device) { if (!device) {
printk(KERN_ERR PREFIX "Memory allocation error\n"); printk(KERN_ERR PREFIX "Memory allocation error\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment