diff options
Diffstat (limited to 'drivers/acpi/parser/psopcode.c')
-rw-r--r-- | drivers/acpi/parser/psopcode.c | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/drivers/acpi/parser/psopcode.c b/drivers/acpi/parser/psopcode.c index 95ef5e8947a8..6f7594a516d2 100644 --- a/drivers/acpi/parser/psopcode.c +++ b/drivers/acpi/parser/psopcode.c | |||
@@ -428,33 +428,23 @@ acpi_ps_get_opcode_info ( | |||
428 | /* | 428 | /* |
429 | * Detect normal 8-bit opcode or extended 16-bit opcode | 429 | * Detect normal 8-bit opcode or extended 16-bit opcode |
430 | */ | 430 | */ |
431 | switch ((u8) (opcode >> 8)) { | 431 | if (!(opcode & 0xFF00)) { |
432 | case 0: | ||
433 | |||
434 | /* Simple (8-bit) opcode: 0-255, can't index beyond table */ | 432 | /* Simple (8-bit) opcode: 0-255, can't index beyond table */ |
435 | 433 | ||
436 | return (&acpi_gbl_aml_op_info [acpi_gbl_short_op_index [(u8) opcode]]); | 434 | return (&acpi_gbl_aml_op_info [acpi_gbl_short_op_index [(u8) opcode]]); |
435 | } | ||
437 | 436 | ||
438 | case AML_EXTOP: | 437 | if (((opcode & 0xFF00) == AML_EXTENDED_OPCODE) && |
439 | 438 | (((u8) opcode) <= MAX_EXTENDED_OPCODE)) { | |
440 | /* Extended (16-bit, prefix+opcode) opcode */ | 439 | /* Valid extended (16-bit) opcode */ |
441 | |||
442 | if (((u8) opcode) <= MAX_EXTENDED_OPCODE) { | ||
443 | return (&acpi_gbl_aml_op_info [acpi_gbl_long_op_index [(u8) opcode]]); | ||
444 | } | ||
445 | |||
446 | /* Else fall through to error case below */ | ||
447 | /*lint -fallthrough */ | ||
448 | |||
449 | default: | ||
450 | 440 | ||
451 | ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, | 441 | return (&acpi_gbl_aml_op_info [acpi_gbl_long_op_index [(u8) opcode]]); |
452 | "Unknown AML opcode [%4.4X]\n", opcode)); | ||
453 | break; | ||
454 | } | 442 | } |
455 | 443 | ||
444 | /* Unknown AML opcode */ | ||
456 | 445 | ||
457 | /* Default is "unknown opcode" */ | 446 | ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, |
447 | "Unknown AML opcode [%4.4X]\n", opcode)); | ||
458 | 448 | ||
459 | return (&acpi_gbl_aml_op_info [_UNK]); | 449 | return (&acpi_gbl_aml_op_info [_UNK]); |
460 | } | 450 | } |