public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: android: ion: Fixing NULL comparison style
@ 2015-11-19 16:59 Anjali Menon
  2015-11-19 17:36 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Anjali Menon @ 2015-11-19 16:59 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Anjali Menon

Using checkpatch.pl fixed the check.

CHECK: Comparison to NULL could be written "!data"

Signed-off-by: Anjali Menon <cse.anjalimenon@gmail.com>
---
 drivers/staging/android/ion/compat_ion.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/android/ion/compat_ion.c b/drivers/staging/android/ion/compat_ion.c
index a402fda..8a0df9c 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" == NULL)
 			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" == NULL)
 			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" == NULL)
 			return -EFAULT;
 
 		err = compat_get_ion_custom_data(data32, data);
-- 
1.9.1


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

* Re: [PATCH] staging: android: ion: Fixing NULL comparison style
  2015-11-19 16:59 [PATCH] staging: android: ion: Fixing NULL comparison style Anjali Menon
@ 2015-11-19 17:36 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2015-11-19 17:36 UTC (permalink / raw)
  To: Anjali Menon; +Cc: devel, linux-kernel

On Thu, Nov 19, 2015 at 10:29:53PM +0530, Anjali Menon wrote:
> Using checkpatch.pl fixed the check.
> 
> CHECK: Comparison to NULL could be written "!data"
> 
> Signed-off-by: Anjali Menon <cse.anjalimenon@gmail.com>
> ---
>  drivers/staging/android/ion/compat_ion.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/android/ion/compat_ion.c b/drivers/staging/android/ion/compat_ion.c
> index a402fda..8a0df9c 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" == NULL)

I don't think you compiled this code :(

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

end of thread, other threads:[~2015-11-19 17:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-19 16:59 [PATCH] staging: android: ion: Fixing NULL comparison style Anjali Menon
2015-11-19 17:36 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox