public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ipc: mqueue.c: avoid NULL comparison
@ 2020-03-30 10:38 Payal Kshirsagar
  2020-03-30 10:46 ` [Outreachy kernel] " Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Payal Kshirsagar @ 2020-03-30 10:38 UTC (permalink / raw)
  To: akpm, dave, viro, elfring, manfred, keescook, linux-kernel,
	outreachy-kernel
  Cc: Payal Kshirsagar

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Outreachy kernel] [PATCH] ipc: mqueue.c: avoid NULL comparison
  2020-03-30 10:38 [PATCH] ipc: mqueue.c: avoid NULL comparison Payal Kshirsagar
@ 2020-03-30 10:46 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2020-03-30 10:46 UTC (permalink / raw)
  To: Payal Kshirsagar
  Cc: akpm, dave, viro, elfring, manfred, keescook, linux-kernel,
	outreachy-kernel

On Mon, Mar 30, 2020 at 04:08:26PM +0530, Payal Kshirsagar wrote:
> 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(-)

I can not take any outreachy patches made outside of drivers/staging,
sorry.

So consider this, and your other patch, dropped, sorry.

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-30 10:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-30 10:38 [PATCH] ipc: mqueue.c: avoid NULL comparison Payal Kshirsagar
2020-03-30 10:46 ` [Outreachy kernel] " Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox