From: Eva Rachel Retuya Date: Wed, 21 Sep 2016 04:59:29 +0000 (+0800) Subject: staging: greybus: camera: simplify NULL test X-Git-Tag: v4.9-rc1~119^2~262 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ce35e9be62837d8242472264b511f9c27992adfa;p=karo-tx-linux.git 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 --- 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)) {