linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpu/drm/virtio/virtgpu_vq.c: Use kmem_cache_zalloc
@ 2018-10-19 15:59 Sabyasachi Gupta
  2018-10-23  4:06 ` Souptick Joarder
  0 siblings, 1 reply; 4+ messages in thread
From: Sabyasachi Gupta @ 2018-10-19 15:59 UTC (permalink / raw)
  To: airlied, kraxel
  Cc: jrdr.linux, dri-devel, virtualization, linux-kernel, brajeswar.linux

Replaced kmem_cache_alloc + memset with kmem_cache_zalloc
Signed-off-by: Sabyasachi Gupta <sabyasachi.linux@gmail.com>
---
 drivers/gpu/drm/virtio/virtgpu_vq.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c
index 020070d..e001b79 100644
--- a/drivers/gpu/drm/virtio/virtgpu_vq.c
+++ b/drivers/gpu/drm/virtio/virtgpu_vq.c
@@ -98,10 +98,9 @@ virtio_gpu_get_vbuf(struct virtio_gpu_device *vgdev,
 {
 	struct virtio_gpu_vbuffer *vbuf;
 
-	vbuf = kmem_cache_alloc(vgdev->vbufs, GFP_KERNEL);
+	vbuf = kmem_cache_zalloc(vgdev->vbufs, GFP_KERNEL);
 	if (!vbuf)
 		return ERR_PTR(-ENOMEM);
-	memset(vbuf, 0, VBUFFER_SIZE);
 
 	BUG_ON(size > MAX_INLINE_CMD_SIZE);
 	vbuf->buf = (void *)vbuf + sizeof(*vbuf);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] gpu/drm/virtio/virtgpu_vq.c: Use kmem_cache_zalloc
  2018-10-19 15:59 [PATCH] gpu/drm/virtio/virtgpu_vq.c: Use kmem_cache_zalloc Sabyasachi Gupta
@ 2018-10-23  4:06 ` Souptick Joarder
  2018-10-23  9:50   ` Jani Nikula
  0 siblings, 1 reply; 4+ messages in thread
From: Souptick Joarder @ 2018-10-23  4:06 UTC (permalink / raw)
  To: Sabyasachi Gupta
  Cc: airlied, Gerd Hoffmann, dri-devel, virtualization, linux-kernel,
	Brajeswar Ghosh

On Fri, Oct 19, 2018 at 9:30 PM Sabyasachi Gupta
<sabyasachi.linux@gmail.com> wrote:
>
> Replaced kmem_cache_alloc + memset with kmem_cache_zalloc

Put a new line gap in between these two lines and send v2.

> Signed-off-by: Sabyasachi Gupta <sabyasachi.linux@gmail.com>
> ---
>  drivers/gpu/drm/virtio/virtgpu_vq.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c
> index 020070d..e001b79 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_vq.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_vq.c
> @@ -98,10 +98,9 @@ virtio_gpu_get_vbuf(struct virtio_gpu_device *vgdev,
>  {
>         struct virtio_gpu_vbuffer *vbuf;
>
> -       vbuf = kmem_cache_alloc(vgdev->vbufs, GFP_KERNEL);
> +       vbuf = kmem_cache_zalloc(vgdev->vbufs, GFP_KERNEL);
>         if (!vbuf)
>                 return ERR_PTR(-ENOMEM);
> -       memset(vbuf, 0, VBUFFER_SIZE);
>
>         BUG_ON(size > MAX_INLINE_CMD_SIZE);
>         vbuf->buf = (void *)vbuf + sizeof(*vbuf);
> --
> 2.7.4
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gpu/drm/virtio/virtgpu_vq.c: Use kmem_cache_zalloc
  2018-10-23  4:06 ` Souptick Joarder
@ 2018-10-23  9:50   ` Jani Nikula
  2018-10-30  5:36     ` Gerd Hoffmann
  0 siblings, 1 reply; 4+ messages in thread
From: Jani Nikula @ 2018-10-23  9:50 UTC (permalink / raw)
  To: Souptick Joarder, Sabyasachi Gupta
  Cc: airlied, linux-kernel, dri-devel, virtualization, Gerd Hoffmann,
	Brajeswar Ghosh

On Tue, 23 Oct 2018, Souptick Joarder <jrdr.linux@gmail.com> wrote:
> On Fri, Oct 19, 2018 at 9:30 PM Sabyasachi Gupta
> <sabyasachi.linux@gmail.com> wrote:
>>
>> Replaced kmem_cache_alloc + memset with kmem_cache_zalloc
>
> Put a new line gap in between these two lines and send v2.

Nah, the maintainers can trivially add the newline while
applying. Review is much more valuable than nitpicking on the commit
message.

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

>
>> Signed-off-by: Sabyasachi Gupta <sabyasachi.linux@gmail.com>
>> ---
>>  drivers/gpu/drm/virtio/virtgpu_vq.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c
>> index 020070d..e001b79 100644
>> --- a/drivers/gpu/drm/virtio/virtgpu_vq.c
>> +++ b/drivers/gpu/drm/virtio/virtgpu_vq.c
>> @@ -98,10 +98,9 @@ virtio_gpu_get_vbuf(struct virtio_gpu_device *vgdev,
>>  {
>>         struct virtio_gpu_vbuffer *vbuf;
>>
>> -       vbuf = kmem_cache_alloc(vgdev->vbufs, GFP_KERNEL);
>> +       vbuf = kmem_cache_zalloc(vgdev->vbufs, GFP_KERNEL);
>>         if (!vbuf)
>>                 return ERR_PTR(-ENOMEM);
>> -       memset(vbuf, 0, VBUFFER_SIZE);
>>
>>         BUG_ON(size > MAX_INLINE_CMD_SIZE);
>>         vbuf->buf = (void *)vbuf + sizeof(*vbuf);
>> --
>> 2.7.4
>>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Jani Nikula, Intel Open Source Graphics Center

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gpu/drm/virtio/virtgpu_vq.c: Use kmem_cache_zalloc
  2018-10-23  9:50   ` Jani Nikula
@ 2018-10-30  5:36     ` Gerd Hoffmann
  0 siblings, 0 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2018-10-30  5:36 UTC (permalink / raw)
  To: Jani Nikula
  Cc: Souptick Joarder, Sabyasachi Gupta, airlied, linux-kernel,
	dri-devel, virtualization, Brajeswar Ghosh

On Tue, Oct 23, 2018 at 12:50:36PM +0300, Jani Nikula wrote:
> On Tue, 23 Oct 2018, Souptick Joarder <jrdr.linux@gmail.com> wrote:
> > On Fri, Oct 19, 2018 at 9:30 PM Sabyasachi Gupta
> > <sabyasachi.linux@gmail.com> wrote:
> >>
> >> Replaced kmem_cache_alloc + memset with kmem_cache_zalloc
> >
> > Put a new line gap in between these two lines and send v2.
> 
> Nah, the maintainers can trivially add the newline while
> applying. Review is much more valuable than nitpicking on the commit
> message.

Queued (and added newline).

thanks,
  Gerd


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-10-30  5:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-19 15:59 [PATCH] gpu/drm/virtio/virtgpu_vq.c: Use kmem_cache_zalloc Sabyasachi Gupta
2018-10-23  4:06 ` Souptick Joarder
2018-10-23  9:50   ` Jani Nikula
2018-10-30  5:36     ` Gerd Hoffmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).