Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: interrupt_controller: intc_plic: rewrite get_plic_dev_from_irq #65807

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

wsipak
Copy link
Contributor

@wsipak wsipak commented Nov 27, 2023

There's a ternary operator that depends on configuration-defined macro: CONFIG_DYNAMIC_INTERRUPTS is not enabled by default for any of the platforms that use PLIC, it is possbile to set it to =y though.

This triggered the Coverity check to report it as dead code.

Fixes #65576.

CC @ycsin

@wsipak wsipak changed the title divers: interrupt_controller: intc_plic: rewrite get_plic_dev_from_irq drivers: interrupt_controller: intc_plic: rewrite get_plic_dev_from_irq Nov 27, 2023
…irq`

There's a ternary operator that depends on configuration-defined macro:
`CONFIG_DYNAMIC_INTERRUPTS` is not enabled by default
for any of the platforms that use PLIC,
it is possbile to set it to `=y` though.

This triggered the Coverity check to report it as dead code.

Fixes zephyrproject-rtos#65576.

Signed-off-by: Wojciech Sipak <wsipak@antmicro.com>
Copy link
Collaborator

@ycsin ycsin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous implementation guarantees that get_plic_dev_from_irq would never return NULL, but this implementation should be fine as well, since z_get_sw_isr_device_from_irq shouldn't return NULL after #65288 is merged

@ycsin ycsin requested a review from cfriedt November 27, 2023 15:50
@carlescufi carlescufi merged commit 76c8bf0 into zephyrproject-rtos:main Nov 29, 2023
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Interrupt Controller area: RISCV RISCV Architecture (32-bit & 64-bit)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Coverity CID: 333379] 'Constant' variable guards dead code in drivers/interrupt_controller/intc_plic.c
5 participants