提交 6eca4b4c 编写于 作者: B Bjorn Helgaas 提交者: Len Brown

ACPI: pci_link: remove unnecessary null pointer checks

Better to oops and learn about a bug than to silently cover it up.
Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: NLen Brown <len.brown@intel.com>
上级 c9d62443
...@@ -179,9 +179,6 @@ static int acpi_pci_link_get_possible(struct acpi_pci_link *link) ...@@ -179,9 +179,6 @@ static int acpi_pci_link_get_possible(struct acpi_pci_link *link)
{ {
acpi_status status; acpi_status status;
if (!link)
return -EINVAL;
status = acpi_walk_resources(link->device->handle, METHOD_NAME__PRS, status = acpi_walk_resources(link->device->handle, METHOD_NAME__PRS,
acpi_pci_link_check_possible, link); acpi_pci_link_check_possible, link);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
...@@ -259,9 +256,6 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link) ...@@ -259,9 +256,6 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link)
acpi_status status; acpi_status status;
int irq = 0; int irq = 0;
if (!link)
return -EINVAL;
link->irq.active = 0; link->irq.active = 0;
/* in practice, status disabled is meaningless, ignore it */ /* in practice, status disabled is meaningless, ignore it */
...@@ -314,7 +308,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) ...@@ -314,7 +308,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
} *resource; } *resource;
struct acpi_buffer buffer = { 0, NULL }; struct acpi_buffer buffer = { 0, NULL };
if (!link || !irq) if (!irq)
return -EINVAL; return -EINVAL;
resource = kzalloc(sizeof(*resource) + 1, irqs_disabled() ? GFP_ATOMIC: GFP_KERNEL); resource = kzalloc(sizeof(*resource) + 1, irqs_disabled() ? GFP_ATOMIC: GFP_KERNEL);
...@@ -712,9 +706,6 @@ static int acpi_pci_link_add(struct acpi_device *device) ...@@ -712,9 +706,6 @@ static int acpi_pci_link_add(struct acpi_device *device)
int i; int i;
int found = 0; int found = 0;
if (!device)
return -EINVAL;
link = kzalloc(sizeof(struct acpi_pci_link), GFP_KERNEL); link = kzalloc(sizeof(struct acpi_pci_link), GFP_KERNEL);
if (!link) if (!link)
return -ENOMEM; return -ENOMEM;
...@@ -795,9 +786,6 @@ static int acpi_pci_link_remove(struct acpi_device *device, int type) ...@@ -795,9 +786,6 @@ static int acpi_pci_link_remove(struct acpi_device *device, int type)
{ {
struct acpi_pci_link *link; struct acpi_pci_link *link;
if (!device || !acpi_driver_data(device))
return -EINVAL;
link = acpi_driver_data(device); link = acpi_driver_data(device);
mutex_lock(&acpi_link_lock); mutex_lock(&acpi_link_lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册