mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vishnu Dasa <vdasa@vmware.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Jorgen Hansen <jhansen@vmware.com>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"acking@vmware.com" <acking@vmware.com>,
	"dtor@vmware.com" <dtor@vmware.com>,
	Pv-drivers <Pv-drivers@vmware.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH 2/3] VMCI: No need to clear memory after a dma_alloc_coherent() call
Date: Thu, 17 Feb 2022 07:10:48 +0000	[thread overview]
Message-ID: <00F97241-10DF-4D3D-9544-105C4E9DC5BB@vmware.com> (raw)
In-Reply-To: <232d7bb2eace0d4dc2228134c6a424472412adfa.1644531317.git.christophe.jaillet@wanadoo.fr>


> On Feb 10, 2022, at 2:27 PM, Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote:
> 
> 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.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> drivers/misc/vmw_vmci/vmci_guest.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/misc/vmw_vmci/vmci_guest.c b/drivers/misc/vmw_vmci/vmci_guest.c
> index 1a1858742f75..02d4722d8474 100644
> --- a/drivers/misc/vmw_vmci/vmci_guest.c
> +++ b/drivers/misc/vmw_vmci/vmci_guest.c
> @@ -706,13 +706,11 @@ static int vmci_guest_probe_device(struct pci_dev *pdev,
> 		vmci_dev->notification_bitmap = dma_alloc_coherent(
> 			&pdev->dev, PAGE_SIZE, &vmci_dev->notification_base,
> 			GFP_KERNEL);
> -		if (!vmci_dev->notification_bitmap) {
> +		if (!vmci_dev->notification_bitmap)
> 			dev_warn(&pdev->dev,
> 				 "Unable to allocate notification bitmap\n");
> -		} else {
> -			memset(vmci_dev->notification_bitmap, 0, PAGE_SIZE);
> +		else
> 			caps_in_use |= VMCI_CAPS_NOTIFICATIONS;
> -		}
> 	}
> 
> 	if (mmio_base != NULL) {
> -- 
> 2.32.0
> 

Thanks!

Acked-by: Vishnu Dasa <vdasa@vmware.com>

  reply	other threads:[~2022-02-17  7:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-10 22:26 [PATCH 0/3] VMCI: Various fixes Christophe JAILLET
2022-02-10 22:27 ` [PATCH 1/3] VMCI: Fix the description of vmci_check_host_caps() Christophe JAILLET
2022-02-17  7:08   ` Vishnu Dasa
2022-02-10 22:27 ` [PATCH 2/3] VMCI: No need to clear memory after a dma_alloc_coherent() call Christophe JAILLET
2022-02-17  7:10   ` Vishnu Dasa [this message]
2022-02-10 22:27 ` [PATCH 3/3] VMCI: Fix some error handling paths in vmci_guest_probe_device() Christophe JAILLET
2022-02-11 14:09   ` Dan Carpenter
2022-02-11 20:06     ` Christophe JAILLET
2022-02-24  6:53       ` Vishnu Dasa
2022-02-24 10:03         ` Dan Carpenter
2022-02-24 16:08           ` Vishnu Dasa
2022-02-24  0:43   ` Vishnu Dasa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=00F97241-10DF-4D3D-9544-105C4E9DC5BB@vmware.com \
    --to=vdasa@vmware.com \
    --cc=Pv-drivers@vmware.com \
    --cc=acking@vmware.com \
    --cc=arnd@arndb.de \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=dtor@vmware.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jhansen@vmware.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®