[rom,refactor] Mark unused arguments explicitly
- Dominant language
- SystemVerilog
- Stars
- 3.6k
- Forks
- 1.1k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 141
Description
### Description
Compiler detects three unused arguments as follows. All three cases are unused as expected.
To improve the code quality, we may want to mark them as unused explicitly, and enable compiler warnings (It’s currently muted).
QQ: Should we treat unused variables as errors or just raise some warnings?
---
```
sw/device/silicon_creator/lib/sigverify/sphincsplus/hash_shake.c:51:44
rom_error_t spx_hash_initialize(spx_ctx_t *ctx) {
^
```
https://github.com/lowRISC/opentitan/blob/605da270ddcf70b2af5573e9524f9613bc89383d/sw/device/silicon_creator/lib/sigverify/sphincsplus/hash_shake.c#L51-L53
---
```
sw/device/silicon_creator/lib/sigverify/rsa_verify.c:157:52
lifecycle_state_t lc_state,
^
```
https://github.com/lowRISC/opentitan/blob/605da270ddcf70b2af5573e9524f9613bc89383d/sw/device/silicon_creator/lib/sigverify/rsa_verify.c#L154-L158
---
```
sw/device/lib/base/mock_mmio.cc:15:47
mmio_region_t mmio_region_from_addr(uintptr_t address) {
^
```
https://github.com/lowRISC/opentitan/blob/605da270ddcf70b2af5573e9524f9613bc89383d/sw/device/lib/base/mock_mmio.cc#L15-L17
Contributor guide
Research direction
Start with the cited functions in sw/device/silicon_creator/lib/sigverify/sphincsplus/hash_shake.c, sw/device/silicon_creator/lib/sigverify/rsa_verify.c, and sw/device/lib/base/mock_mmio.cc, then inspect how compiler warnings are configured. Done means the three unused arguments are marked explicitly and the issue's warning-versus-error policy is settled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, cpp
- Domain
- embedded-iot, tooling
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100