Skip to content

Commit 2c65e31

Browse files
Andrey Strachukrafaeljw
authored andcommitted
ACPI/PCI: Remove useless NULL pointer checks
Local variable 'p' is initialized by an address of field of acpi_resource, so it does not make sense to compare 'p' with NULL. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Andrey Strachuk <[email protected]> Reviewed-by: Bjorn Helgaas <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent e0dccc3 commit 2c65e31

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/acpi/pci_link.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static acpi_status acpi_pci_link_check_possible(struct acpi_resource *resource,
9595
case ACPI_RESOURCE_TYPE_IRQ:
9696
{
9797
struct acpi_resource_irq *p = &resource->data.irq;
98-
if (!p || !p->interrupt_count) {
98+
if (!p->interrupt_count) {
9999
acpi_handle_debug(handle,
100100
"Blank _PRS IRQ resource\n");
101101
return AE_OK;
@@ -121,7 +121,7 @@ static acpi_status acpi_pci_link_check_possible(struct acpi_resource *resource,
121121
{
122122
struct acpi_resource_extended_irq *p =
123123
&resource->data.extended_irq;
124-
if (!p || !p->interrupt_count) {
124+
if (!p->interrupt_count) {
125125
acpi_handle_debug(handle,
126126
"Blank _PRS EXT IRQ resource\n");
127127
return AE_OK;
@@ -182,7 +182,7 @@ static acpi_status acpi_pci_link_check_current(struct acpi_resource *resource,
182182
case ACPI_RESOURCE_TYPE_IRQ:
183183
{
184184
struct acpi_resource_irq *p = &resource->data.irq;
185-
if (!p || !p->interrupt_count) {
185+
if (!p->interrupt_count) {
186186
/*
187187
* IRQ descriptors may have no IRQ# bits set,
188188
* particularly those w/ _STA disabled
@@ -197,7 +197,7 @@ static acpi_status acpi_pci_link_check_current(struct acpi_resource *resource,
197197
{
198198
struct acpi_resource_extended_irq *p =
199199
&resource->data.extended_irq;
200-
if (!p || !p->interrupt_count) {
200+
if (!p->interrupt_count) {
201201
/*
202202
* extended IRQ descriptors must
203203
* return at least 1 IRQ

0 commit comments

Comments
 (0)