drivers/graphics: Fix a couple of warnings
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
//! <https://www.qemu.org/docs/master/specs/standard-vga.html>
|
||||
|
||||
use common::acquire_port_io_rights;
|
||||
use inputd::ProducerHandle;
|
||||
use pcid_interface::PciFunctionHandle;
|
||||
use redox_scheme::{scheme::register_sync_scheme, RequestKind, SignalBehavior, Socket};
|
||||
|
||||
@@ -22,9 +22,7 @@ use libredox::Fd;
|
||||
use redox_scheme::scheme::{register_scheme_inner, SchemeSync};
|
||||
use redox_scheme::{CallerCtx, OpenResult, RequestKind, SignalBehavior, Socket};
|
||||
use syscall::schemev2::NewFdFlags;
|
||||
use syscall::{
|
||||
CallFlags, Error, MapFlags, Result, EACCES, EAGAIN, EBADF, EINVAL, ENOENT, EOPNOTSUPP,
|
||||
};
|
||||
use syscall::{Error, MapFlags, Result, EACCES, EAGAIN, EBADF, EINVAL, ENOENT, EOPNOTSUPP};
|
||||
|
||||
use crate::objects::{DrmObjectId, DrmObjects};
|
||||
use crate::properties::DrmPropertyKind;
|
||||
|
||||
@@ -184,7 +184,7 @@ impl SchemeSync for FbbootlogScheme {
|
||||
&mut self,
|
||||
dirfd: usize,
|
||||
path_str: &str,
|
||||
flags: usize,
|
||||
_flags: usize,
|
||||
_fcntl_flags: u32,
|
||||
_ctx: &CallerCtx,
|
||||
) -> Result<OpenResult> {
|
||||
|
||||
@@ -130,11 +130,7 @@ impl SchemeSync for FbconScheme {
|
||||
flags: syscall::EventFlags,
|
||||
_ctx: &CallerCtx,
|
||||
) -> Result<syscall::EventFlags> {
|
||||
let handle = match self.handles.get_mut(&id) {
|
||||
Some(Handle::Vt(handle)) => Ok(handle),
|
||||
Some(Handle::SchemeRoot) => Err(Error::new(EBADF)),
|
||||
None => Err(Error::new(EBADF)),
|
||||
}?;
|
||||
let handle = self.get_vt_handle_mut(id)?;
|
||||
|
||||
handle.notified_read = false;
|
||||
handle.events = flags;
|
||||
@@ -143,11 +139,7 @@ impl SchemeSync for FbconScheme {
|
||||
}
|
||||
|
||||
fn fpath(&mut self, id: usize, buf: &mut [u8], _ctx: &CallerCtx) -> Result<usize> {
|
||||
let handle = match self.handles.get(&id) {
|
||||
Some(Handle::Vt(handle)) => Ok(handle),
|
||||
Some(Handle::SchemeRoot) => Err(Error::new(EBADF)),
|
||||
None => Err(Error::new(EBADF)),
|
||||
}?;
|
||||
let handle = self.get_vt_handle_mut(id)?;
|
||||
|
||||
let path_str = format!("fbcon:{}", handle.vt_i.0);
|
||||
let path = path_str.as_bytes();
|
||||
@@ -162,14 +154,11 @@ impl SchemeSync for FbconScheme {
|
||||
}
|
||||
|
||||
fn fsync(&mut self, id: usize, _ctx: &CallerCtx) -> Result<()> {
|
||||
match self.handles.get(&id) {
|
||||
Some(Handle::Vt(_)) => Ok(()),
|
||||
Some(Handle::SchemeRoot) => Err(Error::new(EBADF)),
|
||||
None => Err(Error::new(EBADF)),
|
||||
}
|
||||
let _handle = self.get_vt_handle_mut(id)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn fcntl(&mut self, id: usize, cmd: usize, arg: usize, _ctx: &CallerCtx) -> Result<usize> {
|
||||
fn fcntl(&mut self, id: usize, _cmd: usize, _arg: usize, _ctx: &CallerCtx) -> Result<usize> {
|
||||
if !self.handles.get(&id).is_some() {
|
||||
return Err(Error::new(EBADF));
|
||||
};
|
||||
@@ -213,13 +202,9 @@ impl SchemeSync for FbconScheme {
|
||||
_fcntl_flags: u32,
|
||||
_ctx: &CallerCtx,
|
||||
) -> Result<usize> {
|
||||
let handle = match self.handles.get(&id) {
|
||||
Some(Handle::Vt(handle)) => Ok(handle),
|
||||
Some(Handle::SchemeRoot) => Err(Error::new(EBADF)),
|
||||
None => Err(Error::new(EBADF)),
|
||||
}?;
|
||||
let vt_i = self.get_vt_handle_mut(id)?.vt_i;
|
||||
|
||||
if let Some(console) = self.vts.get_mut(&handle.vt_i) {
|
||||
if let Some(console) = self.vts.get_mut(&vt_i) {
|
||||
console.write(buf)
|
||||
} else {
|
||||
Err(Error::new(EBADF))
|
||||
|
||||
Reference in New Issue
Block a user