All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] staging: android: fix multiple checkpatch issues
@ 2015-11-01 14:38 Ioana Ciornei
  2015-11-01 14:38 ` [PATCH v2 1/5] staging: android: replace explicit NULL comparison Ioana Ciornei
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Ioana Ciornei @ 2015-11-01 14:38 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: arve, riandrews, Ioana Ciornei

This patchset fixes multiple checkpatch.pl issues.

Changes in v2:
    - fix typos in the commit description of the patch 3/5

Ioana Ciornei (5):
  staging: android: replace explicit NULL comparison
  staging: android: replace uint32_t with u32
  staging: android: properly align function arguments
  staging: android: remove multiple blank lines
  staging: android: add comment to spinlock_t definition

 drivers/staging/android/ion/compat_ion.c  |  6 +++---
 drivers/staging/android/lowmemorykiller.c |  6 +++---
 drivers/staging/android/sync.c            | 22 +++++++++++-----------
 drivers/staging/android/timed_gpio.c      | 13 ++++++-------
 4 files changed, 23 insertions(+), 24 deletions(-)

-- 
2.1.4



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

* [PATCH v2 1/5] staging: android: replace explicit NULL comparison
  2015-11-01 14:38 [PATCH v2 0/5] staging: android: fix multiple checkpatch issues Ioana Ciornei
@ 2015-11-01 14:38 ` Ioana Ciornei
  2015-11-01 14:38 ` [PATCH v2 2/5] staging: android: replace uint32_t with u32 Ioana Ciornei
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Ioana Ciornei @ 2015-11-01 14:38 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: arve, riandrews, Ioana Ciornei

This patch replaces explicit NULL comparison with !
operator in order to simplify the code

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
---
Changes in v2:
    - nothing

 drivers/staging/android/ion/compat_ion.c |  6 +++---
 drivers/staging/android/sync.c           | 18 +++++++++---------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/android/ion/compat_ion.c b/drivers/staging/android/ion/compat_ion.c
index a402fda..9a978d2 100644
--- a/drivers/staging/android/ion/compat_ion.c
+++ b/drivers/staging/android/ion/compat_ion.c
@@ -137,7 +137,7 @@ long compat_ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 
 		data32 = compat_ptr(arg);
 		data = compat_alloc_user_space(sizeof(*data));
-		if (data == NULL)
+		if (!data)
 			return -EFAULT;
 
 		err = compat_get_ion_allocation_data(data32, data);
@@ -156,7 +156,7 @@ long compat_ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 
 		data32 = compat_ptr(arg);
 		data = compat_alloc_user_space(sizeof(*data));
-		if (data == NULL)
+		if (!data)
 			return -EFAULT;
 
 		err = compat_get_ion_handle_data(data32, data);
@@ -173,7 +173,7 @@ long compat_ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 
 		data32 = compat_ptr(arg);
 		data = compat_alloc_user_space(sizeof(*data));
-		if (data == NULL)
+		if (!data)
 			return -EFAULT;
 
 		err = compat_get_ion_custom_data(data32, data);
diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c
index f83e00c..5413f28 100644
--- a/drivers/staging/android/sync.c
+++ b/drivers/staging/android/sync.c
@@ -43,7 +43,7 @@ struct sync_timeline *sync_timeline_create(const struct sync_timeline_ops *ops,
 		return NULL;
 
 	obj = kzalloc(size, GFP_KERNEL);
-	if (obj == NULL)
+	if (!obj)
 		return NULL;
 
 	kref_init(&obj->kref);
@@ -130,7 +130,7 @@ struct sync_pt *sync_pt_create(struct sync_timeline *obj, int size)
 		return NULL;
 
 	pt = kzalloc(size, GFP_KERNEL);
-	if (pt == NULL)
+	if (!pt)
 		return NULL;
 
 	spin_lock_irqsave(&obj->child_list_lock, flags);
@@ -155,7 +155,7 @@ static struct sync_fence *sync_fence_alloc(int size, const char *name)
 	struct sync_fence *fence;
 
 	fence = kzalloc(size, GFP_KERNEL);
-	if (fence == NULL)
+	if (!fence)
 		return NULL;
 
 	fence->file = anon_inode_getfile("sync_fence", &sync_fence_fops,
@@ -193,7 +193,7 @@ struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt)
 	struct sync_fence *fence;
 
 	fence = sync_fence_alloc(offsetof(struct sync_fence, cbs[1]), name);
-	if (fence == NULL)
+	if (!fence)
 		return NULL;
 
 	fence->num_fences = 1;
@@ -215,7 +215,7 @@ struct sync_fence *sync_fence_fdget(int fd)
 {
 	struct file *file = fget(fd);
 
-	if (file == NULL)
+	if (!file)
 		return NULL;
 
 	if (file->f_op != &sync_fence_fops)
@@ -262,7 +262,7 @@ struct sync_fence *sync_fence_merge(const char *name,
 	unsigned long size = offsetof(struct sync_fence, cbs[num_fences]);
 
 	fence = sync_fence_alloc(size, name);
-	if (fence == NULL)
+	if (!fence)
 		return NULL;
 
 	atomic_set(&fence->status, num_fences);
@@ -583,14 +583,14 @@ static long sync_fence_ioctl_merge(struct sync_fence *fence, unsigned long arg)
 	}
 
 	fence2 = sync_fence_fdget(data.fd2);
-	if (fence2 == NULL) {
+	if (!fence2) {
 		err = -ENOENT;
 		goto err_put_fd;
 	}
 
 	data.name[sizeof(data.name) - 1] = '\0';
 	fence3 = sync_fence_merge(data.name, fence, fence2);
-	if (fence3 == NULL) {
+	if (!fence3) {
 		err = -ENOMEM;
 		goto err_put_fence2;
 	}
@@ -666,7 +666,7 @@ static long sync_fence_ioctl_fence_info(struct sync_fence *fence,
 		size = 4096;
 
 	data = kzalloc(size, GFP_KERNEL);
-	if (data == NULL)
+	if (!data)
 		return -ENOMEM;
 
 	strlcpy(data->name, fence->name, sizeof(data->name));
-- 
2.1.4



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

* [PATCH v2 2/5] staging: android: replace uint32_t with u32
  2015-11-01 14:38 [PATCH v2 0/5] staging: android: fix multiple checkpatch issues Ioana Ciornei
  2015-11-01 14:38 ` [PATCH v2 1/5] staging: android: replace explicit NULL comparison Ioana Ciornei
@ 2015-11-01 14:38 ` Ioana Ciornei
  2015-11-01 14:38 ` [PATCH v2 3/5] staging: android: properly align function arguments Ioana Ciornei
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Ioana Ciornei @ 2015-11-01 14:38 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: arve, riandrews, Ioana Ciornei

This patch makes use of the preferred kernel types such
as u16, u32.

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
---
Changes in v2:
    - nothing

 drivers/staging/android/lowmemorykiller.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
index e679d84..de65db7 100644
--- a/drivers/staging/android/lowmemorykiller.c
+++ b/drivers/staging/android/lowmemorykiller.c
@@ -43,7 +43,7 @@
 #include <linux/profile.h>
 #include <linux/notifier.h>
 
-static uint32_t lowmem_debug_level = 1;
+static u32 lowmem_debug_level = 1;
 static short lowmem_adj[6] = {
 	0,
 	1,
-- 
2.1.4



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

* [PATCH v2 3/5] staging: android: properly align function arguments
  2015-11-01 14:38 [PATCH v2 0/5] staging: android: fix multiple checkpatch issues Ioana Ciornei
  2015-11-01 14:38 ` [PATCH v2 1/5] staging: android: replace explicit NULL comparison Ioana Ciornei
  2015-11-01 14:38 ` [PATCH v2 2/5] staging: android: replace uint32_t with u32 Ioana Ciornei
@ 2015-11-01 14:38 ` Ioana Ciornei
  2015-11-01 14:38 ` [PATCH v2 4/5] staging: android: remove multiple blank lines Ioana Ciornei
  2015-11-01 14:38 ` [PATCH v2 5/5] staging: android: add comment to spinlock_t definition Ioana Ciornei
  4 siblings, 0 replies; 8+ messages in thread
From: Ioana Ciornei @ 2015-11-01 14:38 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: arve, riandrews, Ioana Ciornei

Fix alingment issues by properly indenting function arguments
in accordance with the kernel coding style.

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
---
Changes in v2:
    - fix typos in the commit description

 drivers/staging/android/lowmemorykiller.c |  4 ++--
 drivers/staging/android/sync.c            |  4 ++--
 drivers/staging/android/timed_gpio.c      | 10 +++++-----
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
index de65db7..8b5a4a8 100644
--- a/drivers/staging/android/lowmemorykiller.c
+++ b/drivers/staging/android/lowmemorykiller.c
@@ -105,8 +105,8 @@ static unsigned long lowmem_scan(struct shrinker *s, struct shrink_control *sc)
 	}
 
 	lowmem_print(3, "lowmem_scan %lu, %x, ofree %d %d, ma %hd\n",
-			sc->nr_to_scan, sc->gfp_mask, other_free,
-			other_file, min_score_adj);
+		     sc->nr_to_scan, sc->gfp_mask, other_free,
+		     other_file, min_score_adj);
 
 	if (min_score_adj == OOM_SCORE_ADJ_MAX + 1) {
 		lowmem_print(5, "lowmem_scan %lu, %x, return 0\n",
diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c
index 5413f28..e0c1acb 100644
--- a/drivers/staging/android/sync.c
+++ b/drivers/staging/android/sync.c
@@ -313,7 +313,7 @@ struct sync_fence *sync_fence_merge(const char *name,
 EXPORT_SYMBOL(sync_fence_merge);
 
 int sync_fence_wake_up_wq(wait_queue_t *curr, unsigned mode,
-				 int wake_flags, void *key)
+			  int wake_flags, void *key)
 {
 	struct sync_fence_waiter *wait;
 
@@ -353,7 +353,7 @@ int sync_fence_wait_async(struct sync_fence *fence,
 EXPORT_SYMBOL(sync_fence_wait_async);
 
 int sync_fence_cancel_async(struct sync_fence *fence,
-			     struct sync_fence_waiter *waiter)
+			    struct sync_fence_waiter *waiter)
 {
 	unsigned long flags;
 	int ret = 0;
diff --git a/drivers/staging/android/timed_gpio.c b/drivers/staging/android/timed_gpio.c
index ce11726..5246f42 100644
--- a/drivers/staging/android/timed_gpio.c
+++ b/drivers/staging/android/timed_gpio.c
@@ -76,8 +76,8 @@ static void gpio_enable(struct timed_output_dev *dev, int value)
 			value = data->max_timeout;
 
 		hrtimer_start(&data->timer,
-			ktime_set(value / 1000, (value % 1000) * 1000000),
-			HRTIMER_MODE_REL);
+			      ktime_set(value / 1000, (value % 1000) * 1000000),
+			      HRTIMER_MODE_REL);
 	}
 
 	spin_unlock_irqrestore(&data->lock, flags);
@@ -94,8 +94,8 @@ static int timed_gpio_probe(struct platform_device *pdev)
 		return -EBUSY;
 
 	gpio_data = devm_kzalloc(&pdev->dev,
-			sizeof(struct timed_gpio_data) * pdata->num_gpios,
-			GFP_KERNEL);
+				 sizeof(*gpio_data) * pdata->num_gpios,
+				 GFP_KERNEL);
 	if (!gpio_data)
 		return -ENOMEM;
 
@@ -104,7 +104,7 @@ static int timed_gpio_probe(struct platform_device *pdev)
 		gpio_dat = &gpio_data[i];
 
 		hrtimer_init(&gpio_dat->timer, CLOCK_MONOTONIC,
-				HRTIMER_MODE_REL);
+			     HRTIMER_MODE_REL);
 		gpio_dat->timer.function = gpio_timer_func;
 		spin_lock_init(&gpio_dat->lock);
 
-- 
2.1.4



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

* [PATCH v2 4/5] staging: android: remove multiple blank lines
  2015-11-01 14:38 [PATCH v2 0/5] staging: android: fix multiple checkpatch issues Ioana Ciornei
                   ` (2 preceding siblings ...)
  2015-11-01 14:38 ` [PATCH v2 3/5] staging: android: properly align function arguments Ioana Ciornei
@ 2015-11-01 14:38 ` Ioana Ciornei
  2015-11-01 14:38 ` [PATCH v2 5/5] staging: android: add comment to spinlock_t definition Ioana Ciornei
  4 siblings, 0 replies; 8+ messages in thread
From: Ioana Ciornei @ 2015-11-01 14:38 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: arve, riandrews, Ioana Ciornei

This patch removes multiple blank lines in order to follow
the linux kernel coding style.

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
---
Changes in v2:
    - nothing

 drivers/staging/android/timed_gpio.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/android/timed_gpio.c b/drivers/staging/android/timed_gpio.c
index 5246f42..bcd9924 100644
--- a/drivers/staging/android/timed_gpio.c
+++ b/drivers/staging/android/timed_gpio.c
@@ -25,7 +25,6 @@
 #include "timed_output.h"
 #include "timed_gpio.h"
 
-
 struct timed_gpio_data {
 	struct timed_output_dev dev;
 	struct hrtimer timer;
-- 
2.1.4



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

* [PATCH v2 5/5] staging: android: add comment to spinlock_t definition
  2015-11-01 14:38 [PATCH v2 0/5] staging: android: fix multiple checkpatch issues Ioana Ciornei
                   ` (3 preceding siblings ...)
  2015-11-01 14:38 ` [PATCH v2 4/5] staging: android: remove multiple blank lines Ioana Ciornei
@ 2015-11-01 14:38 ` Ioana Ciornei
  2015-11-03 20:21   ` [Outreachy kernel] " Greg KH
  4 siblings, 1 reply; 8+ messages in thread
From: Ioana Ciornei @ 2015-11-01 14:38 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: arve, riandrews, Ioana Ciornei

Add comment to the spinlock_t fields of struct timed_gpio_data in
order to follow the linux coding style.

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
---
Changes in v2:
    - nothing

 drivers/staging/android/timed_gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/android/timed_gpio.c b/drivers/staging/android/timed_gpio.c
index bcd9924..99f8473 100644
--- a/drivers/staging/android/timed_gpio.c
+++ b/drivers/staging/android/timed_gpio.c
@@ -28,7 +28,7 @@
 struct timed_gpio_data {
 	struct timed_output_dev dev;
 	struct hrtimer timer;
-	spinlock_t lock;
+	spinlock_t lock; /* protects the fields of timed_gpio_data */
 	unsigned gpio;
 	int max_timeout;
 	u8 active_low;
-- 
2.1.4



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

* Re: [Outreachy kernel] [PATCH v2 5/5] staging: android: add comment to spinlock_t definition
  2015-11-01 14:38 ` [PATCH v2 5/5] staging: android: add comment to spinlock_t definition Ioana Ciornei
@ 2015-11-03 20:21   ` Greg KH
  2015-11-04  7:57     ` Ioana Ciornei
  0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2015-11-03 20:21 UTC (permalink / raw)
  To: Ioana Ciornei; +Cc: outreachy-kernel, arve, riandrews

On Sun, Nov 01, 2015 at 04:38:24PM +0200, Ioana Ciornei wrote:
> Add comment to the spinlock_t fields of struct timed_gpio_data in
> order to follow the linux coding style.
> 
> Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
> ---
> Changes in v2:
>     - nothing
> 
>  drivers/staging/android/timed_gpio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/android/timed_gpio.c b/drivers/staging/android/timed_gpio.c
> index bcd9924..99f8473 100644
> --- a/drivers/staging/android/timed_gpio.c
> +++ b/drivers/staging/android/timed_gpio.c
> @@ -28,7 +28,7 @@
>  struct timed_gpio_data {
>  	struct timed_output_dev dev;
>  	struct hrtimer timer;
> -	spinlock_t lock;
> +	spinlock_t lock; /* protects the fields of timed_gpio_data */

Not really, that's not what this lock protects, please re-read the
driver to figure this out exactly.  But, I wouldn't really worry about
this, I need to just delete this driver, no one uses it anymore...

thanks,

greg k-h


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

* Re: [Outreachy kernel] [PATCH v2 5/5] staging: android: add comment to spinlock_t definition
  2015-11-03 20:21   ` [Outreachy kernel] " Greg KH
@ 2015-11-04  7:57     ` Ioana Ciornei
  0 siblings, 0 replies; 8+ messages in thread
From: Ioana Ciornei @ 2015-11-04  7:57 UTC (permalink / raw)
  To: Greg KH; +Cc: outreachy-kernel, arve, riandrews

On Tue, Nov 3, 2015 at 10:21 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Sun, Nov 01, 2015 at 04:38:24PM +0200, Ioana Ciornei wrote:
>> Add comment to the spinlock_t fields of struct timed_gpio_data in
>> order to follow the linux coding style.
>>
>> Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
>> ---
>> Changes in v2:
>>     - nothing
>>
>>  drivers/staging/android/timed_gpio.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/android/timed_gpio.c b/drivers/staging/android/timed_gpio.c
>> index bcd9924..99f8473 100644
>> --- a/drivers/staging/android/timed_gpio.c
>> +++ b/drivers/staging/android/timed_gpio.c
>> @@ -28,7 +28,7 @@
>>  struct timed_gpio_data {
>>       struct timed_output_dev dev;
>>       struct hrtimer timer;
>> -     spinlock_t lock;
>> +     spinlock_t lock; /* protects the fields of timed_gpio_data */
>
> Not really, that's not what this lock protects, please re-read the
> driver to figure this out exactly.  But, I wouldn't really worry about
> this, I need to just delete this driver, no one uses it anymore...

Ok. So no version 3?

Thanks,

Ioana

> thanks,
>
> greg k-h


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

end of thread, other threads:[~2015-11-04  7:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-01 14:38 [PATCH v2 0/5] staging: android: fix multiple checkpatch issues Ioana Ciornei
2015-11-01 14:38 ` [PATCH v2 1/5] staging: android: replace explicit NULL comparison Ioana Ciornei
2015-11-01 14:38 ` [PATCH v2 2/5] staging: android: replace uint32_t with u32 Ioana Ciornei
2015-11-01 14:38 ` [PATCH v2 3/5] staging: android: properly align function arguments Ioana Ciornei
2015-11-01 14:38 ` [PATCH v2 4/5] staging: android: remove multiple blank lines Ioana Ciornei
2015-11-01 14:38 ` [PATCH v2 5/5] staging: android: add comment to spinlock_t definition Ioana Ciornei
2015-11-03 20:21   ` [Outreachy kernel] " Greg KH
2015-11-04  7:57     ` Ioana Ciornei

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.