public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
To: akpm@linux-foundation.org, dave@stgolabs.net,
	viro@zeniv.linux.org.uk, elfring@users.sourceforge.net,
	manfred@colorfullife.com, keescook@chromium.org,
	linux-kernel@vger.kernel.org, outreachy-kernel@googlegroups.com
Cc: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
Subject: [PATCH] ipc: mqueue.c: avoid NULL comparison
Date: Mon, 30 Mar 2020 16:08:26 +0530	[thread overview]
Message-ID: <20200330103826.6531-1-payalskshirsagar1234@gmail.com> (raw)

Change suggested by coccinelle.
Avoid NULL comparison, compare using boolean negation.

Signed-off-by: Payal Kshirsagar <payalskshirsagar1234@gmail.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


             reply	other threads:[~2020-03-30 10:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-30 10:38 Payal Kshirsagar [this message]
2020-03-30 10:46 ` [Outreachy kernel] [PATCH] ipc: mqueue.c: avoid NULL comparison Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200330103826.6531-1-payalskshirsagar1234@gmail.com \
    --to=payalskshirsagar1234@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave@stgolabs.net \
    --cc=elfring@users.sourceforge.net \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox