diff options
| author | Ruan Jinjie <[email protected]> | 2023-08-15 09:24:34 +0000 |
|---|---|---|
| committer | Juergen Gross <[email protected]> | 2023-08-21 07:54:05 +0000 |
| commit | 71281ec9c82608c42d6841a75ced97aecd4274be (patch) | |
| tree | 81a858a114040194e4af10e6b3c56356bc6130f7 | |
| parent | xen-pciback: Remove unused function declarations (diff) | |
| download | kernel-71281ec9c82608c42d6841a75ced97aecd4274be.tar.gz kernel-71281ec9c82608c42d6841a75ced97aecd4274be.zip | |
xen: Switch to use kmemdup() helper
Use kmemdup() helper instead of open-coding to
simplify the code.
Signed-off-by: Ruan Jinjie <[email protected]>
Reviewed-by: Juergen Gross <[email protected]>
Reviewed-by: Chen Jiahao <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Juergen Gross <[email protected]>
| -rw-r--r-- | drivers/xen/xen-acpi-processor.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/xen/xen-acpi-processor.c b/drivers/xen/xen-acpi-processor.c index 9cb61db67efd..296703939846 100644 --- a/drivers/xen/xen-acpi-processor.c +++ b/drivers/xen/xen-acpi-processor.c @@ -473,11 +473,8 @@ static int xen_upload_processor_pm_data(void) if (!_pr) continue; - if (!pr_backup) { - pr_backup = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL); - if (pr_backup) - memcpy(pr_backup, _pr, sizeof(struct acpi_processor)); - } + if (!pr_backup) + pr_backup = kmemdup(_pr, sizeof(*_pr), GFP_KERNEL); (void)upload_pm_data(_pr); } |
