File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -299,11 +299,9 @@ pub struct IrqDescriptor {
299
299
300
300
fn irq_format_descriptor ( bytes : & [ u8 ] ) -> Result < Resource , AmlError > {
301
301
302
- // We do `- 1` here so the arms below match specification. It doesn't
303
- // count byte 0 for some reason.
304
- match bytes. len ( ) - 1 {
305
- 0 ..=1 => Err ( AmlError :: ResourceDescriptorTooShort ) ,
306
- 2 => {
302
+ match bytes. len ( ) {
303
+ 0 ..=2 => Err ( AmlError :: ResourceDescriptorTooShort ) ,
304
+ 3 => { // 2 in spec
307
305
let irq = LittleEndian :: read_u16 ( & bytes[ 1 ..=2 ] ) ;
308
306
309
307
Ok ( Resource :: Irq ( IrqDescriptor {
@@ -316,7 +314,7 @@ fn irq_format_descriptor(bytes: &[u8]) -> Result<Resource, AmlError> {
316
314
is_consumer : false // Is this correct?
317
315
} ) )
318
316
} ,
319
- 3 => {
317
+ 4 => { // 3 in spec
320
318
let irq = LittleEndian :: read_u16 ( & bytes[ 1 ..=2 ] ) ;
321
319
322
320
let information = bytes[ 3 ] ;
You can’t perform that action at this time.
0 commit comments