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 <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56265
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Angel Pons 2021-07-13 19:03:29 +02:00 committed by Tim Wawrzynczak
parent 275ade9539
commit afab34c372
1 changed files with 1 additions and 1 deletions

View File

@ -132,7 +132,7 @@ bool usb_acpi_get_pld(const struct device *usb_device, struct acpi_pld *pld)
return false; return false;
if (config->use_custom_pld) if (config->use_custom_pld)
memcpy(pld, &config->custom_pld, sizeof(pld)); *pld = config->custom_pld;
else else
acpi_pld_fill_usb(pld, config->type, &config->group); acpi_pld_fill_usb(pld, config->type, &config->group);