All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: iio: adc: ad7192: Fix block comment
  2016-09-30 16:27 [PATCH 0/2] Fix multiple checkpatch warning Anchal Jain
@ 2016-09-30 16:24 ` Anchal Jain
  2016-10-02 10:30   ` Greg KH
  2016-09-30 16:36 ` [PATCH 2/2] staging: android: ion: Replace structure with the *pointer of structure in kzalloc Anchal Jain
  1 sibling, 1 reply; 5+ messages in thread
From: Anchal Jain @ 2016-09-30 16:24 UTC (permalink / raw)
  To: gregkh; +Cc: outreachy-kernel, knaack.h, pmeerw

This patch fix the problem of block comment when the block comment 
detect by the checkpatch.pl 
CHECK: Block comments use a trailing */ on a separate line
so to fix this problem just remove trailing */ and add it on the next line

Signed-off-by: Anchal Jain <anchalj109@gmail.com>
---
 drivers/staging/iio/adc/ad7192.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
index f843f19..7c0635f 100644
--- a/drivers/staging/iio/adc/ad7192.c
+++ b/drivers/staging/iio/adc/ad7192.c
@@ -36,9 +36,11 @@
 #define AD7192_REG_ID		4 /* ID Register	     (RO, 8-bit) */
 #define AD7192_REG_GPOCON	5 /* GPOCON Register	     (RO, 8-bit) */
 #define AD7192_REG_OFFSET	6 /* Offset Register	     (RW, 16-bit
-				   * (AD7792)/24-bit (AD7192)) */
+				   * (AD7792)/24-bit (AD7192))
+				   */
 #define AD7192_REG_FULLSALE	7 /* Full-Scale Register
-				   * (RW, 16-bit (AD7792)/24-bit (AD7192)) */
+				   * (RW, 16-bit (AD7792)/24-bit (AD7192))
+				   */
 
 /* Communications Register Bit Designations (AD7192_REG_COMM) */
 #define AD7192_COMM_WEN		BIT(7) /* Write Enable */
@@ -81,12 +83,15 @@
 
 /* Mode Register: AD7192_MODE_CLKSRC options */
 #define AD7192_CLK_EXT_MCLK1_2		0 /* External 4.92 MHz Clock connected
-					   * from MCLK1 to MCLK2 */
+					   * from MCLK1 to MCLK2
+					   */
 #define AD7192_CLK_EXT_MCLK2		1 /* External Clock applied to MCLK2 */
 #define AD7192_CLK_INT			2 /* Internal 4.92 MHz Clock not
-					   * available at the MCLK2 pin */
+					   * available at the MCLK2 pin
+					   */
 #define AD7192_CLK_INT_CO		3 /* Internal 4.92 MHz Clock available
-					   * at the MCLK2 pin */
+					   * at the MCLK2 pin
+					   */
 
 /* Configuration Register Bit Designations (AD7192_REG_CONF) */
 
-- 
1.9.1



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

* [PATCH 0/2] Fix multiple checkpatch warning
@ 2016-09-30 16:27 Anchal Jain
  2016-09-30 16:24 ` [PATCH] staging: iio: adc: ad7192: Fix block comment Anchal Jain
  2016-09-30 16:36 ` [PATCH 2/2] staging: android: ion: Replace structure with the *pointer of structure in kzalloc Anchal Jain
  0 siblings, 2 replies; 5+ messages in thread
From: Anchal Jain @ 2016-09-30 16:27 UTC (permalink / raw)
  To: gregkh; +Cc: outreachy-kernel

0001-staging-android-ion-add-comment-to-mutex.patch
0002-staging-android-ion-Replace-structure-with-the-point.patch

Anchal Jain (2):

  staging: android: ion: Replace structure with the *pointer of
    structure in kzalloc
  staging: android: ion: add comment to mutex

 drivers/staging/android/ion/ion.c       | 14 +++++++-------
 drivers/staging/iio/adc/ad7192.c        | 15 ++++++++++-----
 drivers/staging/rtl8188eu/core/rtw_ap.c |  6 +++---
 3 files changed, 20 insertions(+), 15 deletions(-)

-- 
1.9.1



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

* [PATCH 2/2] staging: android: ion: Replace structure with the *pointer of structure in kzalloc
  2016-09-30 16:27 [PATCH 0/2] Fix multiple checkpatch warning Anchal Jain
  2016-09-30 16:24 ` [PATCH] staging: iio: adc: ad7192: Fix block comment Anchal Jain
@ 2016-09-30 16:36 ` Anchal Jain
  2016-09-30 17:35   ` [Outreachy kernel] " Julia Lawall
  1 sibling, 1 reply; 5+ messages in thread
From: Anchal Jain @ 2016-09-30 16:36 UTC (permalink / raw)
  To: gregkh; +Cc: outreachy-kernel, arve, riandrews

Replace structure with the *pointer of stucture in kzalloc 
Use pointer instead of structure to save memory and run faster because it 
doesn't have to duplicate the data.

Signed-off-by: Anchal Jain <anchalj109@gmail.com>
---
 drivers/staging/android/ion/ion.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index 7ff2a7e..5f94aee 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(*ion_buffer_create), GFP_KERNEL);
 	if (!buffer)
 		return ERR_PTR(-ENOMEM);
 
@@ -341,7 +341,7 @@ static struct ion_handle *ion_handle_create(struct ion_client *client,
 {
 	struct ion_handle *handle;
 
-	handle = kzalloc(sizeof(struct ion_handle), GFP_KERNEL);
+	handle = kzalloc(sizeof(*handle), GFP_KERNEL);
 	if (!handle)
 		return ERR_PTR(-ENOMEM);
 	kref_init(&handle->ref);
@@ -802,7 +802,7 @@ struct ion_client *ion_client_create(struct ion_device *dev,
 	}
 	task_unlock(current->group_leader);
 
-	client = kzalloc(sizeof(struct ion_client), GFP_KERNEL);
+	client = kzalloc(sizeof(*ion_client_create), GFP_KERNEL);
 	if (!client)
 		goto err_put_task_struct;
 
@@ -1010,7 +1010,7 @@ static void ion_vm_open(struct vm_area_struct *vma)
 	struct ion_buffer *buffer = vma->vm_private_data;
 	struct ion_vma_list *vma_list;
 
-	vma_list = kmalloc(sizeof(struct ion_vma_list), GFP_KERNEL);
+	vma_list = kmalloc(sizeof(*vma_list), GFP_KERNEL);
 	if (!vma_list)
 		return;
 	vma_list->vma = vma;
@@ -1621,7 +1621,7 @@ struct ion_device *ion_device_create(long (*custom_ioctl)
 	struct ion_device *idev;
 	int ret;
 
-	idev = kzalloc(sizeof(struct ion_device), GFP_KERNEL);
+	idev = kzalloc(sizeof(*ion_device_create), GFP_KERNEL);
 	if (!idev)
 		return ERR_PTR(-ENOMEM);
 
-- 
1.9.1



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

* Re: [Outreachy kernel] [PATCH 2/2] staging: android: ion: Replace structure with the *pointer of structure in kzalloc
  2016-09-30 16:36 ` [PATCH 2/2] staging: android: ion: Replace structure with the *pointer of structure in kzalloc Anchal Jain
@ 2016-09-30 17:35   ` Julia Lawall
  0 siblings, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2016-09-30 17:35 UTC (permalink / raw)
  To: Anchal Jain; +Cc: gregkh, outreachy-kernel, arve, riandrews



On Fri, 30 Sep 2016, Anchal Jain wrote:

> Replace structure with the *pointer of stucture in kzalloc
> Use pointer instead of structure to save memory and run faster because it
> doesn't have to duplicate the data.

The explanation is not correct.  The argument of sizeof is not evaluated.
The compiler just checks the type, and replaces the sizeof call with the
size of the type.

Look at Documentation/CodingStyle for the proper reason why the form *x
may be preferred.

>
> Signed-off-by: Anchal Jain <anchalj109@gmail.com>
> ---
>  drivers/staging/android/ion/ion.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
> index 7ff2a7e..5f94aee 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(*ion_buffer_create), GFP_KERNEL);

This is not correct.  ion_buffer_create is a function that returns a value
of type struct ion_buffer.  I'm a bit surprised that this would compile,
but in any case it would not give the same size as the size of the
structure.

Check the subsequent changes accordingly.

julia

>  	if (!buffer)
>  		return ERR_PTR(-ENOMEM);
>
> @@ -341,7 +341,7 @@ static struct ion_handle *ion_handle_create(struct ion_client *client,
>  {
>  	struct ion_handle *handle;
>
> -	handle = kzalloc(sizeof(struct ion_handle), GFP_KERNEL);
> +	handle = kzalloc(sizeof(*handle), GFP_KERNEL);
>  	if (!handle)
>  		return ERR_PTR(-ENOMEM);
>  	kref_init(&handle->ref);
> @@ -802,7 +802,7 @@ struct ion_client *ion_client_create(struct ion_device *dev,
>  	}
>  	task_unlock(current->group_leader);
>
> -	client = kzalloc(sizeof(struct ion_client), GFP_KERNEL);
> +	client = kzalloc(sizeof(*ion_client_create), GFP_KERNEL);
>  	if (!client)
>  		goto err_put_task_struct;
>
> @@ -1010,7 +1010,7 @@ static void ion_vm_open(struct vm_area_struct *vma)
>  	struct ion_buffer *buffer = vma->vm_private_data;
>  	struct ion_vma_list *vma_list;
>
> -	vma_list = kmalloc(sizeof(struct ion_vma_list), GFP_KERNEL);
> +	vma_list = kmalloc(sizeof(*vma_list), GFP_KERNEL);
>  	if (!vma_list)
>  		return;
>  	vma_list->vma = vma;
> @@ -1621,7 +1621,7 @@ struct ion_device *ion_device_create(long (*custom_ioctl)
>  	struct ion_device *idev;
>  	int ret;
>
> -	idev = kzalloc(sizeof(struct ion_device), GFP_KERNEL);
> +	idev = kzalloc(sizeof(*ion_device_create), GFP_KERNEL);
>  	if (!idev)
>  		return ERR_PTR(-ENOMEM);
>
> --
> 1.9.1
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/2d05b9d8c7873fa3e04438f4deabadc372e132df.1475252219.git.anchalj109%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


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

* Re: [PATCH] staging: iio: adc: ad7192: Fix block comment
  2016-09-30 16:24 ` [PATCH] staging: iio: adc: ad7192: Fix block comment Anchal Jain
@ 2016-10-02 10:30   ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2016-10-02 10:30 UTC (permalink / raw)
  To: Anchal Jain; +Cc: outreachy-kernel, knaack.h, pmeerw

On Fri, Sep 30, 2016 at 09:54:02PM +0530, Anchal Jain wrote:
> This patch fix the problem of block comment when the block comment 
> detect by the checkpatch.pl 
> CHECK: Block comments use a trailing */ on a separate line
> so to fix this problem just remove trailing */ and add it on the next line
> 
> Signed-off-by: Anchal Jain <anchalj109@gmail.com>
> ---
>  drivers/staging/iio/adc/ad7192.c | 15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)

Please always cc: the proper maintainers for stuff like this, I think
you forgot some...

thanks,

greg k-h


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

end of thread, other threads:[~2016-10-02 10:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-30 16:27 [PATCH 0/2] Fix multiple checkpatch warning Anchal Jain
2016-09-30 16:24 ` [PATCH] staging: iio: adc: ad7192: Fix block comment Anchal Jain
2016-10-02 10:30   ` Greg KH
2016-09-30 16:36 ` [PATCH 2/2] staging: android: ion: Replace structure with the *pointer of structure in kzalloc Anchal Jain
2016-09-30 17:35   ` [Outreachy kernel] " Julia Lawall

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.