[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200330103826.6531-1-payalskshirsagar1234@gmail.com>
Date: Mon, 30 Mar 2020 16:08:26 +0530
From: Payal Kshirsagar <payalskshirsagar1234@...il.com>
To: akpm@...ux-foundation.org, dave@...olabs.net,
viro@...iv.linux.org.uk, elfring@...rs.sourceforge.net,
manfred@...orfullife.com, keescook@...omium.org,
linux-kernel@...r.kernel.org, outreachy-kernel@...glegroups.com
Cc: Payal Kshirsagar <payalskshirsagar1234@...il.com>
Subject: [PATCH] ipc: mqueue.c: avoid NULL comparison
Change suggested by coccinelle.
Avoid NULL comparison, compare using boolean negation.
Signed-off-by: Payal Kshirsagar <payalskshirsagar1234@...il.com>
---
ipc/mqueue.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 49a05ba3000d..dbc987d71445 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -1361,7 +1361,7 @@ static int do_mq_notify(mqd_t mqdes, const struct sigevent *notification)
ret = 0;
spin_lock(&info->lock);
- if (notification == NULL) {
+ if (!notification) {
if (info->notify_owner == task_tgid(current)) {
remove_notification(info);
inode->i_atime = inode->i_ctime = current_time(inode);
@@ -1688,7 +1688,7 @@ static int __init init_mqueue_fs(void)
mqueue_inode_cachep = kmem_cache_create("mqueue_inode_cache",
sizeof(struct mqueue_inode_info), 0,
SLAB_HWCACHE_ALIGN|SLAB_ACCOUNT, init_once);
- if (mqueue_inode_cachep == NULL)
+ if (!mqueue_inode_cachep)
return -ENOMEM;
/* ignore failures - they are not fatal */
--
2.17.1
Powered by blists - more mailing lists