Skip to content

Commit

Permalink
fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
aarkegz committed Dec 12, 2024
1 parent 2c7ab80 commit 850d5f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/axhal/src/platform/riscv64_qemu_virt/boot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ static mut BOOT_STACK: [u8; TASK_STACK_SIZE] = [0; TASK_STACK_SIZE];
#[link_section = ".data.boot_page_table"]
static mut BOOT_PT_SV39: [u64; 512] = [0; 512];

#[warn(clippy::identity_op)] // (0x0 << 10) here makes sense because it's an address
#[allow(clippy::identity_op)] // (0x0 << 10) here makes sense because it's an address
unsafe fn init_boot_page_table() {
// 0x0000_0000..0x4000_0000, VRWX_GAD, 1G block
BOOT_PT_SV39[0] = (0x0 << 10) | 0xef;
Expand Down
2 changes: 2 additions & 0 deletions modules/axhal/src/platform/x86_pc/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ pub fn epochoffset_nanos() -> u64 {
pub fn set_oneshot_timer(deadline_ns: u64) {
let lapic = super::apic::local_apic();
let now_ns = crate::time::monotonic_time_nanos();
#[allow(static_mut_refs)]
unsafe {
if now_ns < deadline_ns {
// allow static_mut_refs because we're just reading the value
let apic_ticks = NANOS_TO_LAPIC_TICKS_RATIO.mul_trunc(deadline_ns - now_ns);
assert!(apic_ticks <= u32::MAX as u64);
lapic.set_timer_initial(apic_ticks.max(1) as u32);
Expand Down

0 comments on commit 850d5f6

Please sign in to comment.