Commit 375fb53e authored by Ioana Ciornei's avatar Ioana Ciornei Committed by Greg Kroah-Hartman

staging: android: replace explicit NULL comparison

This patch replaces explicit NULL comparison with !
operator in order to simplify the code
Signed-off-by: default avatarIoana Ciornei <ciorneiioana@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8d831d45
...@@ -137,7 +137,7 @@ long compat_ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) ...@@ -137,7 +137,7 @@ long compat_ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
data32 = compat_ptr(arg); data32 = compat_ptr(arg);
data = compat_alloc_user_space(sizeof(*data)); data = compat_alloc_user_space(sizeof(*data));
if (data == NULL) if (!data)
return -EFAULT; return -EFAULT;
err = compat_get_ion_allocation_data(data32, data); 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) ...@@ -156,7 +156,7 @@ long compat_ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
data32 = compat_ptr(arg); data32 = compat_ptr(arg);
data = compat_alloc_user_space(sizeof(*data)); data = compat_alloc_user_space(sizeof(*data));
if (data == NULL) if (!data)
return -EFAULT; return -EFAULT;
err = compat_get_ion_handle_data(data32, data); 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) ...@@ -173,7 +173,7 @@ long compat_ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
data32 = compat_ptr(arg); data32 = compat_ptr(arg);
data = compat_alloc_user_space(sizeof(*data)); data = compat_alloc_user_space(sizeof(*data));
if (data == NULL) if (!data)
return -EFAULT; return -EFAULT;
err = compat_get_ion_custom_data(data32, data); err = compat_get_ion_custom_data(data32, data);
......
...@@ -43,7 +43,7 @@ struct sync_timeline *sync_timeline_create(const struct sync_timeline_ops *ops, ...@@ -43,7 +43,7 @@ struct sync_timeline *sync_timeline_create(const struct sync_timeline_ops *ops,
return NULL; return NULL;
obj = kzalloc(size, GFP_KERNEL); obj = kzalloc(size, GFP_KERNEL);
if (obj == NULL) if (!obj)
return NULL; return NULL;
kref_init(&obj->kref); kref_init(&obj->kref);
...@@ -130,7 +130,7 @@ struct sync_pt *sync_pt_create(struct sync_timeline *obj, int size) ...@@ -130,7 +130,7 @@ struct sync_pt *sync_pt_create(struct sync_timeline *obj, int size)
return NULL; return NULL;
pt = kzalloc(size, GFP_KERNEL); pt = kzalloc(size, GFP_KERNEL);
if (pt == NULL) if (!pt)
return NULL; return NULL;
spin_lock_irqsave(&obj->child_list_lock, flags); spin_lock_irqsave(&obj->child_list_lock, flags);
...@@ -155,7 +155,7 @@ static struct sync_fence *sync_fence_alloc(int size, const char *name) ...@@ -155,7 +155,7 @@ static struct sync_fence *sync_fence_alloc(int size, const char *name)
struct sync_fence *fence; struct sync_fence *fence;
fence = kzalloc(size, GFP_KERNEL); fence = kzalloc(size, GFP_KERNEL);
if (fence == NULL) if (!fence)
return NULL; return NULL;
fence->file = anon_inode_getfile("sync_fence", &sync_fence_fops, 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) ...@@ -193,7 +193,7 @@ struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt)
struct sync_fence *fence; struct sync_fence *fence;
fence = sync_fence_alloc(offsetof(struct sync_fence, cbs[1]), name); fence = sync_fence_alloc(offsetof(struct sync_fence, cbs[1]), name);
if (fence == NULL) if (!fence)
return NULL; return NULL;
fence->num_fences = 1; fence->num_fences = 1;
...@@ -215,7 +215,7 @@ struct sync_fence *sync_fence_fdget(int fd) ...@@ -215,7 +215,7 @@ struct sync_fence *sync_fence_fdget(int fd)
{ {
struct file *file = fget(fd); struct file *file = fget(fd);
if (file == NULL) if (!file)
return NULL; return NULL;
if (file->f_op != &sync_fence_fops) if (file->f_op != &sync_fence_fops)
...@@ -262,7 +262,7 @@ struct sync_fence *sync_fence_merge(const char *name, ...@@ -262,7 +262,7 @@ struct sync_fence *sync_fence_merge(const char *name,
unsigned long size = offsetof(struct sync_fence, cbs[num_fences]); unsigned long size = offsetof(struct sync_fence, cbs[num_fences]);
fence = sync_fence_alloc(size, name); fence = sync_fence_alloc(size, name);
if (fence == NULL) if (!fence)
return NULL; return NULL;
atomic_set(&fence->status, num_fences); atomic_set(&fence->status, num_fences);
...@@ -583,14 +583,14 @@ static long sync_fence_ioctl_merge(struct sync_fence *fence, unsigned long arg) ...@@ -583,14 +583,14 @@ static long sync_fence_ioctl_merge(struct sync_fence *fence, unsigned long arg)
} }
fence2 = sync_fence_fdget(data.fd2); fence2 = sync_fence_fdget(data.fd2);
if (fence2 == NULL) { if (!fence2) {
err = -ENOENT; err = -ENOENT;
goto err_put_fd; goto err_put_fd;
} }
data.name[sizeof(data.name) - 1] = '\0'; data.name[sizeof(data.name) - 1] = '\0';
fence3 = sync_fence_merge(data.name, fence, fence2); fence3 = sync_fence_merge(data.name, fence, fence2);
if (fence3 == NULL) { if (!fence3) {
err = -ENOMEM; err = -ENOMEM;
goto err_put_fence2; goto err_put_fence2;
} }
...@@ -666,7 +666,7 @@ static long sync_fence_ioctl_fence_info(struct sync_fence *fence, ...@@ -666,7 +666,7 @@ static long sync_fence_ioctl_fence_info(struct sync_fence *fence,
size = 4096; size = 4096;
data = kzalloc(size, GFP_KERNEL); data = kzalloc(size, GFP_KERNEL);
if (data == NULL) if (!data)
return -ENOMEM; return -ENOMEM;
strlcpy(data->name, fence->name, sizeof(data->name)); strlcpy(data->name, fence->name, sizeof(data->name));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment