All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: android: ion: remove duplicate buffer field initializes
@ 2018-04-21  2:56 Todd Poynor
  2018-04-23 12:24 ` Sumit Semwal
  0 siblings, 1 reply; 2+ messages in thread
From: Todd Poynor @ 2018-04-21  2:56 UTC (permalink / raw)
  To: Laura Abbott, Sumit Semwal, Greg Kroah-Hartman
  Cc: devel, linux-kernel, Todd Poynor

As a result of various previous patches, ion_buffer_create() now
has two sets of identical statements for initializing two fields of
the buffer struct, next to each other.  Remove one set.

Move the initialization of these two fields together with the
statements that initialize the other two fields from the function
parameters, prior to the heap allocate() call, for consistency.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Acked-by: Sumit Semwal <sumit.semwal@linaro.org>
---
 drivers/staging/android/ion/ion.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index e74db7902549..269a431646be 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -74,6 +74,8 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap,
 
 	buffer->heap = heap;
 	buffer->flags = flags;
+	buffer->dev = dev;
+	buffer->size = len;
 
 	ret = heap->ops->allocate(heap, buffer, len, flags);
 
@@ -93,11 +95,7 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap,
 		goto err1;
 	}
 
-	buffer->dev = dev;
-	buffer->size = len;
 
-	buffer->dev = dev;
-	buffer->size = len;
 	INIT_LIST_HEAD(&buffer->attachments);
 	mutex_init(&buffer->lock);
 	mutex_lock(&dev->buffer_lock);
-- 
2.17.0.484.g0c8726318c-goog

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

* Re: [PATCH] staging: android: ion: remove duplicate buffer field initializes
  2018-04-21  2:56 [PATCH] staging: android: ion: remove duplicate buffer field initializes Todd Poynor
@ 2018-04-23 12:24 ` Sumit Semwal
  0 siblings, 0 replies; 2+ messages in thread
From: Sumit Semwal @ 2018-04-23 12:24 UTC (permalink / raw)
  To: Todd Poynor; +Cc: Laura Abbott, Greg Kroah-Hartman, devel, LKML

Hello Todd,

Thanks for the patch.

On 21 April 2018 at 08:26, Todd Poynor <toddpoynor@google.com> wrote:
> As a result of various previous patches, ion_buffer_create() now
> has two sets of identical statements for initializing two fields of
> the buffer struct, next to each other.  Remove one set.
>
> Move the initialization of these two fields together with the
> statements that initialize the other two fields from the function
> parameters, prior to the heap allocate() call, for consistency.
>
> Signed-off-by: Todd Poynor <toddpoynor@google.com>

Acked-by: Sumit Semwal <sumit.semwal@linaro.org>

> ---
>  drivers/staging/android/ion/ion.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
> index e74db7902549..269a431646be 100644
> --- a/drivers/staging/android/ion/ion.c
> +++ b/drivers/staging/android/ion/ion.c
> @@ -74,6 +74,8 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap,
>
>         buffer->heap = heap;
>         buffer->flags = flags;
> +       buffer->dev = dev;
> +       buffer->size = len;
>
>         ret = heap->ops->allocate(heap, buffer, len, flags);
>
> @@ -93,11 +95,7 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap,
>                 goto err1;
>         }
>
> -       buffer->dev = dev;
> -       buffer->size = len;
>
> -       buffer->dev = dev;
> -       buffer->size = len;
>         INIT_LIST_HEAD(&buffer->attachments);
>         mutex_init(&buffer->lock);
>         mutex_lock(&dev->buffer_lock);
> --
> 2.17.0.484.g0c8726318c-goog
>


Best,
Sumit.

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

end of thread, other threads:[~2018-04-23 12:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-21  2:56 [PATCH] staging: android: ion: remove duplicate buffer field initializes Todd Poynor
2018-04-23 12:24 ` Sumit Semwal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.