]> git.ipfire.org Git - thirdparty/linux.git/commit
ACPI: bus: Adjust acpi_osc_handshake() parameter list
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 26 Dec 2025 13:48:45 +0000 (14:48 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 2 Jan 2026 12:08:42 +0000 (13:08 +0100)
commit06a17f2beab8c7e9eb9e63c7f89a62a4575cd95b
tree41bb29edf193c37ddf2d0fd07438e3354d0dc083
parentd9239fdc14bcf69fd153ca5daae22c12bd3f8164
ACPI: bus: Adjust acpi_osc_handshake() parameter list

For the sake of interface cleanliness, it is better to avoid using
ACPICA data types in the parameter lists of helper functions that
don't belong to ACPICA, so adjust the parameter list of recently
introduced acpi_osc_handshake() to take a capabilities buffer pointer
and the size of the buffer (in u32 size units) as parameters directly
instead of a struct acpi_buffer pointer.

This is also somewhat more straightforward on the caller side because
they won't need to create struct acpi_buffer objects themselves to pass
them to the helper function and it guarantees that the size of the
buffer in bytes will always be a multiple of 4 (the size of u32).

Moreover, it addresses a premature cap pointer dereference and
eliminates a sizeof(32) that should have been sizeof(u32) [1].

Fixes: e5322888e6bf ("ACPI: bus: Rework the handling of \_SB._OSC platform features")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/linux-acpi/202512242052.W4GhDauV-lkp@intel.com/
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
[ rjw: Fixed typo under sizeof(), used ARRAY_SIZE() in two places ]
Link: https://patch.msgid.link/12833187.O9o76ZdvQC@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/bus.c