summaryrefslogtreecommitdiff
path: root/drivers/acpi/acpica
diff options
context:
space:
mode:
authorErik Schmauss <erik.schmauss@intel.com>2018-12-13 12:30:34 -0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2018-12-13 22:40:51 +0100
commit55e8054dbb35a97c39c270c8fd9478e2c938ebab (patch)
tree8d078c894db7b278879c5203f90891c14af9d250 /drivers/acpi/acpica
parent4c1379d7bb42fa664e0784539208ed74108c53f1 (diff)
ACPICA: change coding style to match ACPICA, no functional change
This commit alters the coding style of the following commit to match ACPICA to keep divergences between Linux and ACPICA at a minimum. This is not intended to result in functional changes. ae6b3e54aa52cd29965b8e4e47000ed2c5d78eb8 Author: Hans de Goede <hdegoede@redhat.com> Date: Sun Nov 18 20:25:35 2018 +0100 ACPICA: Fix handling of buffer-size in acpi_ex_write_data_to_field() Signed-off-by: Erik Schmauss <erik.schmauss@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpica')
-rw-r--r--drivers/acpi/acpica/exserial.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/acpi/acpica/exserial.c b/drivers/acpi/acpica/exserial.c
index 9920fac6413f..ec61553c4483 100644
--- a/drivers/acpi/acpica/exserial.c
+++ b/drivers/acpi/acpica/exserial.c
@@ -244,6 +244,7 @@ acpi_ex_write_serial_bus(union acpi_operand_object *source_desc,
{
acpi_status status;
u32 buffer_length;
+ u32 data_length;
void *buffer;
union acpi_operand_object *buffer_desc;
u32 function;
@@ -324,8 +325,9 @@ acpi_ex_write_serial_bus(union acpi_operand_object *source_desc,
/* Copy the input buffer data to the transfer buffer */
buffer = buffer_desc->buffer.pointer;
- memcpy(buffer, source_desc->buffer.pointer,
- min(buffer_length, source_desc->buffer.length));
+ data_length = (buffer_length < source_desc->buffer.length ?
+ buffer_length : source_desc->buffer.length);
+ memcpy(buffer, source_desc->buffer.pointer, data_length);
/* Lock entire transaction if requested */