Skip to contentSkip to conversation

staging: android: ion: Fixing NULL comparison style

PATCH In review Anjali Menon 2 participants 2 messages Nov 19, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: android: ion: Fixing NULL comparison style

Using checkpatch.pl fixed the check.

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

---
 drivers/staging/android/ion/compat_ion.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/android/ion/compat_ion.c +3 -3
index a402fda..8a0df9c 100644
@@ -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);
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 14 lines · Anjali Menon

Using checkpatch.pl fixed the check.

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

---
 drivers/staging/android/ion/compat_ion.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/android/ion/compat_ion.c +0 -0
index a402fda..8a0df9c 100644

drivers/staging/android/ion/compat_ion.c long compat_ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) · line 140

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