Skip to content

soc: riscv: Remove redundant __soc_is_irq implementations #92696

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

miggazElquez
Copy link
Contributor

Remove __soc_is_irq from WCH, Bouffalolab, and Sensry Ganymed SoCs.

  • For WCH and Bouffalolab SoCs, CONFIG_RISCV_SOC_EXCEPTION_FROM_IRQ is
    not enabled, so the function is never used. In both cases, the
    implementation matches the default fallback (though the Bouffalolab
    version is more complex).

  • For Sensry Ganymed (SY1xx), the config is enabled, but the function's
    logic is identical to the default fallback, making it redundant.

I only tested with a WCH SoC (ch32v303), but for bouffalobab the code was dead and for ganymed SoCs the behaviour should be the exact same.

The __soc_is_irq function is only used when
CONFIG_RISCV_SOC_EXCEPTION_FROM_IRQ is enabled, which is not the case
for any WCH SoC. The implementation is therefore dead code.

Additionally, the implementation matches the default fallback behavior,
so no functional change would occur even if the config were enabled.

Signed-off-by: Miguel Gazquez <miguel.gazquez@bootlin.com>
@miggazElquez
Copy link
Contributor Author

ping @tswaehn as the bot didn't add you as a reviewer. Maybe MAINTAINERS.yml should be fixed ?

@tswaehn
Copy link
Contributor

tswaehn commented Jul 4, 2025

Looks reasonable

@VynDragon
Copy link
Collaborator

This should be unecessary for BFLB, next update already removes this entirely: #91977

The sy1xx SoC enabled CONFIG_RISCV_SOC_EXCEPTION_FROM_IRQ and provided
its own __soc_is_irq implementation. However, the behavior matches the
default implementation, making the override unnecessary.

This commit removes the custom implementation and disables the config
option to remove unnecessary code.

Signed-off-by: Miguel Gazquez <miguel.gazquez@bootlin.com>
@miggazElquez
Copy link
Contributor Author

This should be unecessary for BFLB, next update already removes this entirely: #91977

Okay, I removed the commit for BFLB.

Copy link

sonarqubecloud bot commented Jul 7, 2025

@tswaehn
Copy link
Contributor

tswaehn commented Jul 8, 2025

For Sensry Ganymed (SY1xx), the config is enabled, but the function's
logic is identical to the default fallback, making it redundant.

checked in more detail. disagree.

@miggazElquez
Copy link
Contributor Author

checked in more detail. disagree.

Is there a difference between __soc_is_irq and the fallback that I missed ?

@tswaehn
Copy link
Contributor

tswaehn commented Jul 8, 2025

alright. checked again. and you are correct. pls commit as suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants