master: fix kasli-soc demo compilation warning #274

Merged
sb10q merged 1 commits from morgan/artiq-zynq:demo_warning_fix into master 2024-08-17 17:37:23 +08:00
Owner

Summary

  • fix compilation warning related to use crate::pl::csr; and virtual_led_mapping
  • functional check
    • master: SFP LEDs work
    • satellite: SFP LEDs work
    • standalone: compiled without warning
  • compilation check
    • run nix build <variant> -L for kasli_soc master, satellite, standalone and all built successfully

Compilation Warning before patch

$ nix build .#kasli_soc-demo-firmware -L  
...
firmware>    Compiling io v0.0.0 (/build/src/libio)
firmware> warning: unused import: `crate::pl::csr`
firmware>  --> libboard_artiq/src/io_expander.rs:4:5
firmware>   |
firmware> 4 | use crate::pl::csr;
firmware>   |     ^^^^^^^^^^^^^^
firmware>   |
firmware>   = note: `#[warn(unused_imports)]` on by default
firmware> warning: field is never read: `virtual_led_mapping`
firmware>   --> libboard_artiq/src/io_expander.rs:36:5
firmware>    |
firmware> 36 |     virtual_led_mapping: &'static [(u8, u8, u8)],
firmware>    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
firmware>    |
firmware>    = note: `#[warn(dead_code)]` on by default
firmware> warning: 2 warnings emitted

## Summary - fix compilation warning related to `use crate::pl::csr;` and `virtual_led_mapping` - functional check - master: SFP LEDs work - satellite: SFP LEDs work - standalone: compiled without warning - compilation check - run `nix build <variant> -L` for kasli_soc master, satellite, standalone and all built successfully ## Compilation Warning before patch ```bash $ nix build .#kasli_soc-demo-firmware -L ... firmware> Compiling io v0.0.0 (/build/src/libio) firmware> warning: unused import: `crate::pl::csr` firmware> --> libboard_artiq/src/io_expander.rs:4:5 firmware> | firmware> 4 | use crate::pl::csr; firmware> | ^^^^^^^^^^^^^^ firmware> | firmware> = note: `#[warn(unused_imports)]` on by default firmware> warning: field is never read: `virtual_led_mapping` firmware> --> libboard_artiq/src/io_expander.rs:36:5 firmware> | firmware> 36 | virtual_led_mapping: &'static [(u8, u8, u8)], firmware> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ firmware> | firmware> = note: `#[warn(dead_code)]` on by default firmware> warning: 2 warnings emitted ```
Owner

Does io_expander even make sense if there's no virtual_leds?

On standalone Kasli-SoCs that means the task isn't actually doing anything at the moment.

Does ``io_expander`` even make sense if there's no ``virtual_leds``? On standalone Kasli-SoCs that means the task isn't actually doing anything at the moment.
Author
Owner

Does io_expander even make sense if there's no virtual_leds?

On standalone Kasli-SoCs that means the task isn't actually doing anything at the moment.

What about gating the compilation of io_expander.rs at lib.rs and the io_expander task at main.rs behind has_drtio? Since standalone to my knowledge don't use SFP and hence no io_expander is needed

// At lib.rs
...
#[cfg(all(feature = "target_kasli_soc", has_drtio))]
pub mod io_expander;
...

> Does ``io_expander`` even make sense if there's no ``virtual_leds``? > > On standalone Kasli-SoCs that means the task isn't actually doing anything at the moment. What about gating the compilation of `io_expander.rs` at `lib.rs` and the io_expander task at `main.rs` behind `has_drtio`? Since standalone to my knowledge don't use SFP and hence no io_expander is needed ```rust // At lib.rs ... #[cfg(all(feature = "target_kasli_soc", has_drtio))] pub mod io_expander; ... ```
Owner

Yes, I was actually thinking about that too.

Yes, I was actually thinking about that too.
morgan force-pushed demo_warning_fix from 22d0a22b2e to 4a34777b97 2023-10-25 11:52:11 +08:00 Compare
sb10q merged commit 4a34777b97 into master 2023-10-28 03:26:05 +08:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/artiq-zynq#274
No description provided.