From afab34c3720f673a7edebefe6615ff622253d93e Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Tue, 13 Jul 2021 19:03:29 +0200 Subject: drivers/usb/acpi: Replace unneeded `memcpy` use A regular assignment works just as well and also allows type-checking. It also avoids a common mistake where `sizeof` is applied to a pointer to obtain the size of the data it points to, without dereferencing it. Found-by: Coverity CID 1458231 Change-Id: I7ed05322c3c911f3da4145f81e4d9760a275fec2 Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/56265 Reviewed-by: Raul Rangel Reviewed-by: Furquan Shaikh Reviewed-by: Tim Wawrzynczak Tested-by: build bot (Jenkins) --- src/drivers/usb/acpi/usb_acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/drivers/usb/acpi/usb_acpi.c b/src/drivers/usb/acpi/usb_acpi.c index a0dadff861..8ada939138 100644 --- a/src/drivers/usb/acpi/usb_acpi.c +++ b/src/drivers/usb/acpi/usb_acpi.c @@ -132,7 +132,7 @@ bool usb_acpi_get_pld(const struct device *usb_device, struct acpi_pld *pld) return false; if (config->use_custom_pld) - memcpy(pld, &config->custom_pld, sizeof(pld)); + *pld = config->custom_pld; else acpi_pld_fill_usb(pld, config->type, &config->group); -- cgit v1.2.3