release-7: fix zc706 master and standalone compilation warning #273

Merged
sb10q merged 2 commits from morgan/artiq-zynq:zc706_warning_fix into release-7 2023-11-01 17:45:18 +08:00

Summary

  • fix compilation warning related to core::cell::RefCell, i2c_bus and RTIO_I_STATUS_WAIT_STATUS
  • compilation check
    • run nix build <variant> -L of the following and all built successfully without warnings
    • zc706-acpki_nist_clock-firmware
    • zc706-acpki_nist_clock_master-firmware
    • zc706-acpki_nist_qc2-firmware
    • zc706-acpki_nist_qc2_master-firmware
    • zc706-nist_clock-firmware
    • zc706-nist_clock_master-firmware
    • zc706-nist_qc2-firmware
    • zc706-nist_qc2_master-firmware

Compilation warning before patch

nix build <variant> -L
...
firmware> warning: unused import: `core::cell::RefCell`
firmware>   --> runtime/src/main.rs:15:5
firmware>    |
firmware> 15 | use core::cell::RefCell;
firmware>    |     ^^^^^^^^^^^^^^^^^^^
firmware>    |
firmware>    = note: `#[warn(unused_imports)]` on by default
firmware> warning: unused variable: `i2c_bus`
firmware>    --> runtime/src/main.rs:153:9
firmware>     |
firmware> 153 |     let i2c_bus = unsafe { (i2c::I2C_BUS).as_mut().unwrap() };
firmware>     |         ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_i2c_bus`
firmware>     |
firmware>     = note: `#[warn(unused_variables)]` on by default
firmware> warning: constant is never used: `RTIO_I_STATUS_WAIT_STATUS`
firmware>   --> runtime/src/rtio_acp.rs:14:1
firmware>    |
firmware> 14 | pub const RTIO_I_STATUS_WAIT_STATUS:               i32 = 4; // TODO
firmware>    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
firmware>    |
firmware>    = note: `#[warn(dead_code)]` on by default
firmware> warning: 3 warnings emitted
...
### Summary - fix compilation warning related to core::cell::RefCell, i2c_bus and RTIO_I_STATUS_WAIT_STATUS - compilation check - run `nix build <variant> -L` of the following and all built successfully without warnings - `zc706-acpki_nist_clock-firmware` - `zc706-acpki_nist_clock_master-firmware` - `zc706-acpki_nist_qc2-firmware` - `zc706-acpki_nist_qc2_master-firmware` - `zc706-nist_clock-firmware` - `zc706-nist_clock_master-firmware` - `zc706-nist_qc2-firmware` - `zc706-nist_qc2_master-firmware` ### Compilation warning before patch ```bash nix build <variant> -L ... firmware> warning: unused import: `core::cell::RefCell` firmware> --> runtime/src/main.rs:15:5 firmware> | firmware> 15 | use core::cell::RefCell; firmware> | ^^^^^^^^^^^^^^^^^^^ firmware> | firmware> = note: `#[warn(unused_imports)]` on by default firmware> warning: unused variable: `i2c_bus` firmware> --> runtime/src/main.rs:153:9 firmware> | firmware> 153 | let i2c_bus = unsafe { (i2c::I2C_BUS).as_mut().unwrap() }; firmware> | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_i2c_bus` firmware> | firmware> = note: `#[warn(unused_variables)]` on by default firmware> warning: constant is never used: `RTIO_I_STATUS_WAIT_STATUS` firmware> --> runtime/src/rtio_acp.rs:14:1 firmware> | firmware> 14 | pub const RTIO_I_STATUS_WAIT_STATUS: i32 = 4; // TODO firmware> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ firmware> | firmware> = note: `#[warn(dead_code)]` on by default firmware> warning: 3 warnings emitted ... ```
morgan added 1 commit 2023-10-24 11:06:38 +08:00
morgan changed title from fix zc706 compilation warning to release-7: fix zc706 compilation warning 2023-10-24 11:09:55 +08:00
mwojcik reviewed 2023-10-24 13:19:45 +08:00
@ -149,3 +150,4 @@
i2c::init();
#[cfg(feature = "target_kasli_soc")]
let i2c_bus = unsafe { (i2c::I2C_BUS).as_mut().unwrap() };

Maybe just move it and task::spawn of io_expander_service to the block with io expander settings?

Maybe just move it and task::spawn of io_expander_service to the block with io expander settings?
morgan marked this conversation as resolved
morgan added 1 commit 2023-10-24 17:05:42 +08:00
morgan changed title from release-7: fix zc706 compilation warning to release-7: fix zc706 master and standalone compilation warning 2023-10-26 13:24:15 +08:00
sb10q merged commit 0e75694c6b into release-7 2023-11-01 17:45:18 +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#273
There is no content yet.