Run clippy in CI
Some checks failed
Build / build (push) Failing after 1m52s

This commit is contained in:
Mathieu Strypsteen 2025-01-10 14:18:11 +01:00
parent e3ef4823b3
commit c15febbef8
5 changed files with 7 additions and 4 deletions

View file

@ -28,3 +28,5 @@ jobs:
run: . ~/.bashrc && cargo install cargo-deny run: . ~/.bashrc && cargo install cargo-deny
- name: Run cargo-deny - name: Run cargo-deny
run: . ~/.bashrc && cargo deny check run: . ~/.bashrc && cargo deny check
- name: Run clippy
run: . ~/.bashrc && cargo clippy -- -Dwarnings

View file

@ -57,7 +57,7 @@ pub fn set_cpu_flags() {
} }
let lapic_id = increase_lock_count(); let lapic_id = increase_lock_count();
let cpudata_ref = &CPUDATA[lapic_id].lock(); let cpudata_ref = &CPUDATA[lapic_id].lock();
let cpudata_ref: &CPUData = &cpudata_ref; let cpudata_ref: &CPUData = cpudata_ref;
let cpudata_address = cpudata_ref as *const CPUData as u64; let cpudata_address = cpudata_ref as *const CPUData as u64;
decrease_lock_count(lapic_id); decrease_lock_count(lapic_id);
unsafe { unsafe {

View file

@ -63,7 +63,7 @@ extern "C" fn AcpiOsCreateSemaphore(max: UINT32, initial: UINT32, out: *mut *mut
#[no_mangle] #[no_mangle]
extern "C" fn AcpiOsDeleteLock(handle: *mut c_void) { extern "C" fn AcpiOsDeleteLock(handle: *mut c_void) {
unsafe { unsafe {
drop(Box::from_raw(handle)); drop(Box::from_raw(handle as *mut RawSpinlock));
} }
} }
#[no_mangle] #[no_mangle]

View file

@ -3,6 +3,7 @@ use lock_api::{GuardSend, Mutex, RawMutex};
use super::sync::RawSpinlock; use super::sync::RawSpinlock;
unsafe impl RawMutex for RawSpinlock { unsafe impl RawMutex for RawSpinlock {
#[allow(clippy::declare_interior_mutable_const)]
const INIT: Self = RawSpinlock::new(); const INIT: Self = RawSpinlock::new();
type GuardMarker = GuardSend; type GuardMarker = GuardSend;

View file

@ -32,9 +32,9 @@ pub fn increase_lock_count() -> usize {
if INTERRUPTS_SETUP.load(Ordering::SeqCst) { if INTERRUPTS_SETUP.load(Ordering::SeqCst) {
let lapic_id = get_current_lapic_id(); let lapic_id = get_current_lapic_id();
LOCKS_HELD[lapic_id].fetch_add(1, Ordering::SeqCst); LOCKS_HELD[lapic_id].fetch_add(1, Ordering::SeqCst);
return lapic_id; lapic_id
} else { } else {
return 0; 0
} }
} }
pub fn decrease_lock_count(lapic_id: usize) { pub fn decrease_lock_count(lapic_id: usize) {