fix zc706 compilation warning #261

Merged
sb10q merged 2 commits from morgan/artiq-zynq:fix_zc_warning into master 2023-09-11 15:21:56 +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 for zc706-acpki_nist_clock, zc706-acpki_nist_clock_master, zc706-acpki_nist_clock_satellite and all built successfully

Compilation warning before patch

$ nix build .#zc706-acpki_nist_clock-firmware -L
...
firmware>    Compiling futures v0.3.25
firmware> warning: unused import: `core::cell::RefCell`
firmware>   --> runtime/src/main.rs:16:5
firmware>    |
firmware> 16 | 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:148:9
firmware>     |
firmware> 148 |     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

## Summary - fix compilation warning related to `core::cell::RefCell`, `i2c_bus` and `RTIO_I_STATUS_WAIT_STATUS` - compilation check -run `nix build <variant> -L` for zc706-acpki_nist_clock, zc706-acpki_nist_clock_master, zc706-acpki_nist_clock_satellite and all built successfully ## Compilation warning before patch ```bash $ nix build .#zc706-acpki_nist_clock-firmware -L ... firmware> Compiling futures v0.3.25 firmware> warning: unused import: `core::cell::RefCell` firmware> --> runtime/src/main.rs:16:5 firmware> | firmware> 16 | 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:148:9 firmware> | firmware> 148 | 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 ```
morgan added 1 commit 2023-09-11 15:03:17 +08:00
sb10q reviewed 2023-09-11 15:04:14 +08:00
@ -143,6 +144,7 @@ pub fn main_core0() {
info!("gateware ident: {}", identifier_read(&mut [0; 64]));
i2c::init();
#[allow(unused)]

Why would it be okay to leave this unused?

Why would it be okay to leave this unused?
morgan added 1 commit 2023-09-11 15:13:46 +08:00
sb10q merged commit f3dcd53086 into master 2023-09-11 15:21:56 +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#261
There is no content yet.