All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] ovl: clean up comparsions to NULL
@ 2022-07-12 15:23 williamsukatube
  2022-07-27 13:25 ` Miklos Szeredi
  0 siblings, 1 reply; 2+ messages in thread
From: williamsukatube @ 2022-07-12 15:23 UTC (permalink / raw)
  To: linux-unionfs, linux-kernel; +Cc: miklos, William Dean, Hacash Robot

From: William Dean <williamsukatube@gmail.com>

Clean up comparsions to NULL, simplify as follows:
if (x == NULL) -> if (!x)

Reported-by: Hacash Robot <hacashRobot@santino.com>
Signed-off-by: William Dean <williamsukatube@gmail.com>
---
 fs/overlayfs/readdir.c | 6 +++---
 fs/overlayfs/super.c   | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c
index 78f62cc1797b..953ff22d825c 100644
--- a/fs/overlayfs/readdir.c
+++ b/fs/overlayfs/readdir.c
@@ -182,7 +182,7 @@ static int ovl_cache_entry_add_rb(struct ovl_readdir_data *rdd,
 		return 0;
 
 	p = ovl_cache_entry_new(rdd, name, len, ino, d_type);
-	if (p == NULL) {
+	if (!p) {
 		rdd->err = -ENOMEM;
 		return -ENOMEM;
 	}
@@ -205,7 +205,7 @@ static int ovl_fill_lowest(struct ovl_readdir_data *rdd,
 		list_move_tail(&p->l_node, &rdd->middle);
 	} else {
 		p = ovl_cache_entry_new(rdd, name, namelen, ino, d_type);
-		if (p == NULL)
+		if (!p)
 			rdd->err = -ENOMEM;
 		else
 			list_add_tail(&p->l_node, &rdd->middle);
@@ -538,7 +538,7 @@ static int ovl_fill_plain(struct dir_context *ctx, const char *name,
 
 	rdd->count++;
 	p = ovl_cache_entry_new(rdd, name, namelen, ino, d_type);
-	if (p == NULL) {
+	if (!p) {
 		rdd->err = -ENOMEM;
 		return -ENOMEM;
 	}
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index e0a2e0468ee7..a474cb8040b2 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -468,7 +468,7 @@ static char *ovl_next_opt(char **s)
 	char *sbegin = *s;
 	char *p;
 
-	if (sbegin == NULL)
+	if (!sbegin)
 		return NULL;
 
 	for (p = sbegin; *p; p++) {
@@ -2186,7 +2186,7 @@ static int __init ovl_init(void)
 					     (SLAB_RECLAIM_ACCOUNT|
 					      SLAB_MEM_SPREAD|SLAB_ACCOUNT),
 					     ovl_inode_init_once);
-	if (ovl_inode_cachep == NULL)
+	if (!ovl_inode_cachep)
 		return -ENOMEM;
 
 	err = ovl_aio_request_cache_init();
-- 
2.25.1


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

* Re: [PATCH -next] ovl: clean up comparsions to NULL
  2022-07-12 15:23 [PATCH -next] ovl: clean up comparsions to NULL williamsukatube
@ 2022-07-27 13:25 ` Miklos Szeredi
  0 siblings, 0 replies; 2+ messages in thread
From: Miklos Szeredi @ 2022-07-27 13:25 UTC (permalink / raw)
  To: williamsukatube; +Cc: overlayfs, linux-kernel, William Dean, Hacash Robot

On Tue, 12 Jul 2022 at 17:24, <williamsukatube@163.com> wrote:
>
> From: William Dean <williamsukatube@gmail.com>
>
> Clean up comparsions to NULL, simplify as follows:
> if (x == NULL) -> if (!x)

Again, this has too little worth.  NACK.

Thanks,
Miklos

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

end of thread, other threads:[~2022-07-27 13:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-12 15:23 [PATCH -next] ovl: clean up comparsions to NULL williamsukatube
2022-07-27 13:25 ` Miklos Szeredi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.