Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1407439 > unrolled thread

[PATCH] Staging: android: ion: fixed a kzalloc coding style issue.

Started byShubham Bansal <illusionist.neo@gmail.com>
First post2016-05-26 10:10 +0200
Last post2016-05-26 14:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] Staging: android: ion: fixed a kzalloc coding style issue. Shubham Bansal <illusionist.neo@gmail.com> - 2016-05-26 10:10 +0200
    Re: [PATCH] Staging: android: ion: fixed a kzalloc coding style issue. Luis de Bethencourt <luisbg@osg.samsung.com> - 2016-05-26 14:40 +0200

#1407439 — [PATCH] Staging: android: ion: fixed a kzalloc coding style issue.

FromShubham Bansal <illusionist.neo@gmail.com>
Date2016-05-26 10:10 +0200
Subject[PATCH] Staging: android: ion: fixed a kzalloc coding style issue.
Message-ID<rCYwG-3W0-17@gated-at.bofh.it>
Fixed a coding style issue. Issue reported by checkpatch.pl.

Signed-off-by: Shubham Bansal <illusionist.neo@gmail.com>
---
 drivers/staging/android/ion/ion.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index 8536567..2217ccb 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -184,7 +184,7 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap,
 	struct scatterlist *sg;
 	int i, ret;
 
-	buffer = kzalloc(sizeof(struct ion_buffer), GFP_KERNEL);
+	buffer = kzalloc(sizeof(*buffer), GFP_KERNEL);
 	if (!buffer)
 		return ERR_PTR(-ENOMEM);
 
-- 
2.1.4

[toc] | [next] | [standalone]


#1407542

FromLuis de Bethencourt <luisbg@osg.samsung.com>
Date2016-05-26 14:40 +0200
Message-ID<rD2JX-6r8-11@gated-at.bofh.it>
In reply to#1407439
On 26/05/16 09:01, Shubham Bansal wrote:
> Fixed a coding style issue. Issue reported by checkpatch.pl.
> 
> Signed-off-by: Shubham Bansal <illusionist.neo@gmail.com>
> ---
>  drivers/staging/android/ion/ion.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
> index 8536567..2217ccb 100644
> --- a/drivers/staging/android/ion/ion.c
> +++ b/drivers/staging/android/ion/ion.c
> @@ -184,7 +184,7 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap,
>  	struct scatterlist *sg;
>  	int i, ret;
>  
> -	buffer = kzalloc(sizeof(struct ion_buffer), GFP_KERNEL);
> +	buffer = kzalloc(sizeof(*buffer), GFP_KERNEL);
>  	if (!buffer)
>  		return ERR_PTR(-ENOMEM);
>  
> 


This patch looks good.

It is not a big issue, but have it in mind for the future. When fixing issues
reported by checkpatch, it is nice to paste the output warning of checkpatch
in the commit message.

Look at this example:
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=e7a142aaa09fa5db015fd176d6943f888665829f

Thanks,
Luis

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web