Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Andrey Strachuk and committed by
Hans de Goede
7842efa5 c55ae102

+1 -6
+1 -6
drivers/platform/x86/sony-laptop.c
··· 4341 4341 { 4342 4342 struct acpi_resource_irq *p = &resource->data.irq; 4343 4343 struct sony_pic_irq *interrupt = NULL; 4344 - if (!p || !p->interrupt_count) { 4344 + if (!p->interrupt_count) { 4345 4345 /* 4346 4346 * IRQ descriptors may have no IRQ# bits set, 4347 4347 * particularly those those w/ _STA disabled ··· 4374 4374 struct acpi_resource_io *io = &resource->data.io; 4375 4375 struct sony_pic_ioport *ioport = 4376 4376 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 - 4382 4377 if (!ioport->io1.minimum) { 4383 4378 memcpy(&ioport->io1, io, sizeof(*io)); 4384 4379 dprintk("IO1 at 0x%.4x (0x%.2x)\n", ioport->io1.minimum,