Skip to contentSkip to conversation

Staging: android: ion: fixed a kzalloc coding style issue.

PATCH In review Shubham Bansal 3 participants 3 messages May 26, 2016 – Aug 15, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: android: ion: fixed a kzalloc coding style issue.

Fixed a coding style issue. Issue reported by checkpatch.pl.

---
 drivers/staging/android/ion/ion.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/android/ion/ion.c +1 -1
index 8536567..2217ccb 100644
@@ -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);
 
Signature · 1 line
2.1.4
#1 lore raw
Quoted 13 lines · Shubham Bansal

Fixed a coding style issue. Issue reported by checkpatch.pl.

---
 drivers/staging/android/ion/ion.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/android/ion/ion.c +0 -0
index 8536567..2217ccb 100644

drivers/staging/android/ion/ion.c static struct ion_buffer *ion_buffer_create(struct ion_heap *heap, · line 190

Quoted 8 lines
drivers/staging/android/ion/ion.c +1 -1
@@ -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

maintainer
#2 lore raw
In reply to Shubham Bansal
Quoted 1 line · Shubham Bansal

Fixed a coding style issue. Issue reported by checkpatch.pl.

What coding style issue was fixed?

Be specific please.

thanks,

greg k-h