]> git.baikalelectronics.ru Git - kernel.git/commit
ACPI: OSL: Fix and clean up acpi_os_read/write_port()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 12 Jan 2022 18:31:48 +0000 (19:31 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 25 Jan 2022 17:44:00 +0000 (18:44 +0100)
commiteb58f26056f65a59f77c596520f4a5520b47da53
treeb4cab171f1629db6a816e22f9cf1af0051f781ee
parent991a5e519c2aa1f4ed2bf6e2139997d7e7967cb3
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>
drivers/acpi/osl.c