John Zhao has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/46506 )
Change subject: drivers/uart: Fix control flow DEADCODE issue ......................................................................
drivers/uart: Fix control flow DEADCODE issue
Coverity detects the irq_gpio_index DEADCODE which is initialized as -1. This change updates irq_gpio_index based on irq_gpio.pin_count which differentiates gpio irq or pirq.
Found-by: Coverity CID 1429983 TEST=None
Signed-off-by: John Zhao john.zhao@intel.com Change-Id: I79f85f05b78e5569615ae4c4f7c81cc85c3999c9 --- M src/drivers/uart/acpi/acpi.c 1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/06/46506/1
diff --git a/src/drivers/uart/acpi/acpi.c b/src/drivers/uart/acpi/acpi.c index f9d9d8f..df26f4e 100644 --- a/src/drivers/uart/acpi/acpi.c +++ b/src/drivers/uart/acpi/acpi.c @@ -73,8 +73,10 @@ acpi_device_write_uart(&config->uart);
/* Use either Interrupt() or GpioInt() */ - if (config->irq_gpio.pin_count) + if (config->irq_gpio.pin_count) { acpi_device_write_gpio(&config->irq_gpio); + irq_gpio_index++; + } else acpi_device_write_interrupt(&config->irq);