Commit 2e433a9
committed
ACPI: OSL: Fix and clean up acpi_os_read/write_port()
First, remove type casts that make acpi_os_read_port() only work on
little endian and are generally not needed.
Second, avoid clearing the memory pointed to by the value return
pointer in acpi_os_read_port() if it is the dummy on the stack (in
which case clearing it is not necessary).
Finally, prevent both acpi_os_read_port() and acpi_os_write_port()
from crashing the kernel when they receive an unsupported width
value and make them print a debug message and return an error instead.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>1 parent e783362 commit 2e433a9
1 file changed
Lines changed: 11 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
642 | 642 | | |
643 | 643 | | |
644 | 644 | | |
645 | | - | |
| 645 | + | |
646 | 646 | | |
647 | 647 | | |
648 | 648 | | |
649 | | - | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
650 | 652 | | |
651 | 653 | | |
652 | | - | |
653 | 654 | | |
654 | | - | |
| 655 | + | |
655 | 656 | | |
656 | | - | |
| 657 | + | |
657 | 658 | | |
658 | | - | |
| 659 | + | |
659 | 660 | | |
660 | | - | |
| 661 | + | |
| 662 | + | |
661 | 663 | | |
662 | 664 | | |
663 | 665 | | |
| |||
674 | 676 | | |
675 | 677 | | |
676 | 678 | | |
677 | | - | |
| 679 | + | |
| 680 | + | |
678 | 681 | | |
679 | 682 | | |
680 | 683 | | |
| |||
0 commit comments