mirror of
https://github.com/torvalds/linux
synced 2024-10-07 11:53:31 +00:00
VMCI: No need to clear memory after a dma_alloc_coherent() call
dma_alloc_coherent() already clear the allocated memory, there is no need to explicitly call memset(). This saves a few cycles and a few lines of code. Acked-by: Vishnu Dasa <vdasa@vmware.com> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/3e8c0bfaa77500e22d6c90f249da1c53dbae716e.1645734041.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
b791da2389
commit
cc312da2d3
|
@ -706,13 +706,11 @@ static int vmci_guest_probe_device(struct pci_dev *pdev,
|
||||||
vmci_dev->notification_bitmap = dma_alloc_coherent(
|
vmci_dev->notification_bitmap = dma_alloc_coherent(
|
||||||
&pdev->dev, PAGE_SIZE, &vmci_dev->notification_base,
|
&pdev->dev, PAGE_SIZE, &vmci_dev->notification_base,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!vmci_dev->notification_bitmap) {
|
if (!vmci_dev->notification_bitmap)
|
||||||
dev_warn(&pdev->dev,
|
dev_warn(&pdev->dev,
|
||||||
"Unable to allocate notification bitmap\n");
|
"Unable to allocate notification bitmap\n");
|
||||||
} else {
|
else
|
||||||
memset(vmci_dev->notification_bitmap, 0, PAGE_SIZE);
|
|
||||||
caps_in_use |= VMCI_CAPS_NOTIFICATIONS;
|
caps_in_use |= VMCI_CAPS_NOTIFICATIONS;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mmio_base != NULL) {
|
if (mmio_base != NULL) {
|
||||||
|
|
Loading…
Reference in a new issue