diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2009-02-17 16:00:50 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-03-17 01:52:40 -0400 |
commit | 6eca4b4ca168981d7648be371945c2a21f463a45 (patch) | |
tree | e47781d335040778c5acb4e9513f2b27cee43fb2 /drivers/acpi/pci_link.c | |
parent | c9d6244329c8149312dba27e78dc4a83b35a6ae5 (diff) |
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: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/pci_link.c')
-rw-r--r-- | drivers/acpi/pci_link.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index b59f59efb72f..dd9ebb9fda42 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c | |||
@@ -179,9 +179,6 @@ static int acpi_pci_link_get_possible(struct acpi_pci_link *link) | |||
179 | { | 179 | { |
180 | acpi_status status; | 180 | acpi_status status; |
181 | 181 | ||
182 | if (!link) | ||
183 | return -EINVAL; | ||
184 | |||
185 | status = acpi_walk_resources(link->device->handle, METHOD_NAME__PRS, | 182 | status = acpi_walk_resources(link->device->handle, METHOD_NAME__PRS, |
186 | acpi_pci_link_check_possible, link); | 183 | acpi_pci_link_check_possible, link); |
187 | if (ACPI_FAILURE(status)) { | 184 | if (ACPI_FAILURE(status)) { |
@@ -259,9 +256,6 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link) | |||
259 | acpi_status status; | 256 | acpi_status status; |
260 | int irq = 0; | 257 | int irq = 0; |
261 | 258 | ||
262 | if (!link) | ||
263 | return -EINVAL; | ||
264 | |||
265 | link->irq.active = 0; | 259 | link->irq.active = 0; |
266 | 260 | ||
267 | /* in practice, status disabled is meaningless, ignore it */ | 261 | /* 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 | } *resource; | 308 | } *resource; |
315 | struct acpi_buffer buffer = { 0, NULL }; | 309 | struct acpi_buffer buffer = { 0, NULL }; |
316 | 310 | ||
317 | if (!link || !irq) | 311 | if (!irq) |
318 | return -EINVAL; | 312 | return -EINVAL; |
319 | 313 | ||
320 | resource = kzalloc(sizeof(*resource) + 1, irqs_disabled() ? GFP_ATOMIC: GFP_KERNEL); | 314 | 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 | int i; | 706 | int i; |
713 | int found = 0; | 707 | int found = 0; |
714 | 708 | ||
715 | if (!device) | ||
716 | return -EINVAL; | ||
717 | |||
718 | link = kzalloc(sizeof(struct acpi_pci_link), GFP_KERNEL); | 709 | link = kzalloc(sizeof(struct acpi_pci_link), GFP_KERNEL); |
719 | if (!link) | 710 | if (!link) |
720 | return -ENOMEM; | 711 | return -ENOMEM; |
@@ -795,9 +786,6 @@ static int acpi_pci_link_remove(struct acpi_device *device, int type) | |||
795 | { | 786 | { |
796 | struct acpi_pci_link *link; | 787 | struct acpi_pci_link *link; |
797 | 788 | ||
798 | if (!device || !acpi_driver_data(device)) | ||
799 | return -EINVAL; | ||
800 | |||
801 | link = acpi_driver_data(device); | 789 | link = acpi_driver_data(device); |
802 | 790 | ||
803 | mutex_lock(&acpi_link_lock); | 791 | mutex_lock(&acpi_link_lock); |