Skip to content

Commit 7842efa

Browse files
Andrey Strachukjwrdegoede
authored andcommitted
platform/x86: sony-laptop: Remove useless comparisons in sony_pic_read_possible_resource()
Local variable 'p' is initialized by an address of field of acpi_resource structure, so it does not make sense to compare 'p' with NULL. Local variable 'io' is initialized by an address of field of acpi_resource structure, so it does not make sense to compare 'io' with NULL. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Andrey Strachuk <strochuk@ispras.ru> Link: https://lore.kernel.org/r/20220719110341.7239-1-strochuk@ispras.ru Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 parent c55ae10 commit 7842efa

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

drivers/platform/x86/sony-laptop.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4341,7 +4341,7 @@ sony_pic_read_possible_resource(struct acpi_resource *resource, void *context)
43414341
{
43424342
struct acpi_resource_irq *p = &resource->data.irq;
43434343
struct sony_pic_irq *interrupt = NULL;
4344-
if (!p || !p->interrupt_count) {
4344+
if (!p->interrupt_count) {
43454345
/*
43464346
* IRQ descriptors may have no IRQ# bits set,
43474347
* particularly those those w/ _STA disabled
@@ -4374,11 +4374,6 @@ sony_pic_read_possible_resource(struct acpi_resource *resource, void *context)
43744374
struct acpi_resource_io *io = &resource->data.io;
43754375
struct sony_pic_ioport *ioport =
43764376
list_first_entry(&dev->ioports, struct sony_pic_ioport, list);
4377-
if (!io) {
4378-
dprintk("Blank IO resource\n");
4379-
return AE_OK;
4380-
}
4381-
43824377
if (!ioport->io1.minimum) {
43834378
memcpy(&ioport->io1, io, sizeof(*io));
43844379
dprintk("IO1 at 0x%.4x (0x%.2x)\n", ioport->io1.minimum,

0 commit comments

Comments
 (0)