From 75ac13009dcf03476e89f2628679932f1c05881e Mon Sep 17 00:00:00 2001 From: Stephen Marz Date: Sat, 30 May 2020 12:46:04 -0400 Subject: [PATCH] Fix warnings and unused variables --- risc_v/src/input.rs | 12 +++--------- risc_v/src/syscall.rs | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/risc_v/src/input.rs b/risc_v/src/input.rs index 5e27069..13318d3 100755 --- a/risc_v/src/input.rs +++ b/risc_v/src/input.rs @@ -9,9 +9,9 @@ use core::mem::size_of; use alloc::collections::VecDeque; pub static mut ABS_EVENTS: Option> = None; -pub static mut ABS_OBSERVERS: Option> = None; +// pub static mut ABS_OBSERVERS: Option> = None; pub static mut KEY_EVENTS: Option> = None; -pub static mut KEY_OBSERVERS: Option> = None; +// pub static mut KEY_OBSERVERS: Option> = None; const EVENT_BUFFER_ELEMENTS: usize = 64; @@ -99,13 +99,10 @@ const EVENT_SIZE: usize = size_of::(); pub struct Device { event_queue: *mut Queue, status_queue: *mut Queue, - dev: *mut u32, event_idx: u16, event_ack_used_idx: u16, event_buffer: *mut Event, - status_idx: u16, status_ack_used_idx: u16, - status_buffer: *mut Event, } pub static mut INPUT_DEVICES: [Option; 8] = [ @@ -210,7 +207,7 @@ pub fn setup_input_device(ptr: *mut u32) -> bool { status_bits |= StatusField::DriverOk.val32(); ptr.add(MmioOffsets::Status.scale32()).write_volatile(status_bits); - let config_ptr = ptr.add(MmioOffsets::Config.scale32()) as *mut Config; + // let config_ptr = ptr.add(MmioOffsets::Config.scale32()) as *mut Config; // let mut config = config_ptr.read_volatile(); @@ -224,10 +221,7 @@ pub fn setup_input_device(ptr: *mut u32) -> bool { let mut dev = Device { event_queue: event_queue_ptr, status_queue: status_queue_ptr, - dev: ptr, - status_idx: 0, status_ack_used_idx: 0, - status_buffer: kmalloc(EVENT_SIZE * EVENT_BUFFER_ELEMENTS) as *mut Event, event_idx: 0, event_ack_used_idx: 0, event_buffer: kmalloc(EVENT_SIZE * EVENT_BUFFER_ELEMENTS) as *mut Event, diff --git a/risc_v/src/syscall.rs b/risc_v/src/syscall.rs index 2d744f0..ce481e8 100755 --- a/risc_v/src/syscall.rs +++ b/risc_v/src/syscall.rs @@ -9,7 +9,7 @@ use crate::{block::block_op, elf, fs, gpu, - input::{Event, ABS_EVENTS, ABS_OBSERVERS, KEY_EVENTS, KEY_OBSERVERS}, + input::{Event, ABS_EVENTS, KEY_EVENTS}, page::{map, virt_to_phys, EntryBits, Table, PAGE_SIZE}, process::{add_kernel_process_args, delete_process, get_by_pid, set_sleeping, set_waiting, PROCESS_LIST, PROCESS_LIST_MUTEX}}; use alloc::{boxed::Box, string::String};