From ce35e9be62837d8242472264b511f9c27992adfa Mon Sep 17 00:00:00 2001 From: Eva Rachel Retuya Date: Wed, 21 Sep 2016 12:59:29 +0800 Subject: [PATCH] staging: greybus: camera: simplify NULL test Replace direct comparisons to NULL i.e. 'x == NULL' with '!x' for consistency. Coccinelle semantic patch used: @@ identifier func; expression x; statement Z; @@ x = func(...); if ( ( + ! x - == NULL | + ! - NULL == x ) ) Z Signed-off-by: Eva Rachel Retuya Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/camera.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/greybus/camera.c b/drivers/staging/greybus/camera.c index 46d2e8a9e490..491bdd720c0c 100644 --- a/drivers/staging/greybus/camera.c +++ b/drivers/staging/greybus/camera.c @@ -1121,7 +1121,7 @@ static ssize_t gb_camera_debugfs_write(struct file *file, return -EINVAL; kbuf = kmalloc(len + 1, GFP_KERNEL); - if (kbuf == NULL) + if (!kbuf) return -ENOMEM; if (copy_from_user(kbuf, buf, len)) { -- 2.30.2