On Tue, Feb 25, 2025, at 12:02, Kunihiko Hayashi wrote:
The global variable "irq_type" preserves the current value of ioctl(GET_IRQTYPE).
However, all tests that use interrupts first call ioctl(SET_IRQTYPE) to set test->irq_type, then write the value of test->irq_type into the register pointed by test_reg_bar, and request the interrupt to the endpoint. The endpoint function driver, pci-epf-test, refers to the register, and determine which type of interrupt to raise.
The global variable "irq_type" is never used in the actual test, so remove the variable and replace it with test->irq_type.
And also for the same reason, the variable "no_msi" can be removed.
Initially, test->irq_type has IRQ_TYPE_UNDEFINED, and the ioctl(GET_IRQTYPE) before calling ioctl(SET_IRQTYPE) will return an error.
Suggested-by: Niklas Cassel cassel@kernel.org Suggested-by: Manivannan Sadhasivam manivannan.sadhasivam@linaro.org Signed-off-by: Kunihiko Hayashi hayashi.kunihiko@socionext.com
Nice catch, always good to remove global variables with too generic names.
Acked-by: Arnd Bergmann arnd@arndb.de