Skip to content

Commit

Permalink
aml: suppress all the warnings produced by the crate
Browse files Browse the repository at this point in the history
In some ways, this isn't great, because we're hiding a few areas where
warnings are produced because we're not using some value we probably should
be, but all the warnings produced by the crate are quite noisy for downstream
users so let's suppress them for now.
  • Loading branch information
IsaacWoods committed Sep 13, 2023
1 parent 3759c63 commit 066aa99
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
7 changes: 4 additions & 3 deletions aml/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ impl AmlContext {
use value::MethodCode;

match self.namespace.get_by_path(path)?.clone() {
AmlValue::Method { flags, code } => {
// TODO: respect the method's flags
AmlValue::Method { flags: _, code } => {
/*
* First, set up the state we expect to enter the method with, but clearing local
* variables to "null" and setting the arguments. Save the current method state and scope, so if we're
Expand Down Expand Up @@ -393,7 +394,7 @@ impl AmlContext {
use core::convert::TryInto;
use value::RegionSpace;

let (region_space, region_base, region_length, parent_device) = {
let (region_space, region_base, _region_length, parent_device) = {
if let AmlValue::OpRegion { region, offset, length, parent_device } =
self.namespace.get(region_handle)?
{
Expand Down Expand Up @@ -485,7 +486,7 @@ impl AmlContext {
use core::convert::TryInto;
use value::RegionSpace;

let (region_space, region_base, region_length, parent_device) = {
let (region_space, region_base, _region_length, parent_device) = {
if let AmlValue::OpRegion { region, offset, length, parent_device } =
self.namespace.get(region_handle)?
{
Expand Down
6 changes: 3 additions & 3 deletions aml/src/opcode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ pub const ROOT_CHAR: u8 = b'\\';
pub const PREFIX_CHAR: u8 = b'^';

pub const RESERVED_FIELD: u8 = 0x00;
pub const ACCESS_FIELD: u8 = 0x01;
pub const CONNECT_FIELD: u8 = 0x02;
pub const EXTENDED_ACCESS_FIELD: u8 = 0x03;
// pub const ACCESS_FIELD: u8 = 0x01;
// pub const CONNECT_FIELD: u8 = 0x02;
// pub const EXTENDED_ACCESS_FIELD: u8 = 0x03;

pub const ZERO_OP: u8 = 0x00;
pub const ONE_OP: u8 = 0x01;
Expand Down
2 changes: 1 addition & 1 deletion aml/src/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ where
match term_list(PkgLength::from_raw_length(body, body.len() as u32).unwrap())
.parse(body, context)
{
Ok((_, new_context, result)) => {
Ok((_, new_context, _result)) => {
context = new_context;
}
Err((_, new_context, Propagate::Break)) => {
Expand Down
10 changes: 5 additions & 5 deletions aml/src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ impl AmlValue {
/// depending on the size of the field.
pub fn read_field(&self, context: &AmlContext) -> Result<AmlValue, AmlError> {
if let AmlValue::Field { region, flags, offset, length } = self {
let maximum_access_size = {
let _maximum_access_size = {
if let AmlValue::OpRegion { region, .. } = context.namespace.get(*region)? {
match region {
RegionSpace::SystemMemory => 64,
Expand Down Expand Up @@ -471,7 +471,7 @@ impl AmlValue {
* overwrite the correct bits. We destructure the field to do the actual write, so we read from it if
* needed here, otherwise the borrow-checker doesn't understand.
*/
let field_update_rule = if let AmlValue::Field { region, flags, offset, length } = self {
let field_update_rule = if let AmlValue::Field { flags, .. } = self {
flags.field_update_rule()?
} else {
return Err(AmlError::IncompatibleValueConversion {
Expand All @@ -486,7 +486,7 @@ impl AmlValue {
};

if let AmlValue::Field { region, flags, offset, length } = self {
let maximum_access_size = {
let _maximum_access_size = {
if let AmlValue::OpRegion { region, .. } = context.namespace.get(*region)? {
match region {
RegionSpace::SystemMemory => 64,
Expand Down Expand Up @@ -519,7 +519,7 @@ impl AmlValue {
}
}

pub fn read_buffer_field(&self, context: &AmlContext) -> Result<AmlValue, AmlError> {
pub fn read_buffer_field(&self, _context: &AmlContext) -> Result<AmlValue, AmlError> {
use bitvec::view::BitView;

if let AmlValue::BufferField { buffer_data, offset, length } = self {
Expand Down Expand Up @@ -562,7 +562,7 @@ impl AmlValue {
}
}

pub fn write_buffer_field(&mut self, value: AmlValue, context: &mut AmlContext) -> Result<(), AmlError> {
pub fn write_buffer_field(&mut self, value: AmlValue, _context: &mut AmlContext) -> Result<(), AmlError> {
use bitvec::view::BitView;

if let AmlValue::BufferField { buffer_data, offset, length } = self {
Expand Down

0 comments on commit 066aa99

Please sign in to comment.