Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4496631imw; Tue, 12 Jul 2022 08:58:23 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vEIdroADEXsjqFtaJA9gN2QdJhXvezSad3xRp83f6+frWU4PFH4ByHQfdezMCjuLUk0IHW X-Received: by 2002:a17:907:2856:b0:72b:8e8e:3d9 with SMTP id el22-20020a170907285600b0072b8e8e03d9mr1166585ejc.0.1657641503252; Tue, 12 Jul 2022 08:58:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657641503; cv=none; d=google.com; s=arc-20160816; b=A9r3PDehyiHLyfBLCnGxE7w9qhsnO903n3Xh10cwgXlWGIDTw+peLDyVzVOFYs8nko wX0opv7DQAsynWaGDvDyQN0DeAs8+BeoJZhuWhKb/rcqSm2jUNEo3fVWO3Ez9+b93mVw TBY8y2MOHqEMvJb7fMX4IDFMlcw6fWI8k5egeNRDbMfJBMlqEPslPIwKKB7Gw5cYFpuS rdnG6rdE3PdKc/joPRKmy2AxssM4PjZm8RhbxsNa2W77vYwIJ3c9ixzvgcw9iypsbHit ebX1LwecDfksG117oQnPBxpfnASgoXHpQrEfPhP/Z3ljUL+K66mBpsMPRkOC/KXJEQZK bi+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=G+z5bnYslAb/L5CvdEE281XrI0AtqzAgEbcezhR5z/g=; b=CCChgVIjeSuNU594TW1J6V/RtHNsXeJU3fQl4yUhsS0IdVp2zIWVqsqfjCAo/V0jVJ McyhuHLdV3bTSCtliLyFhbk+BVUor9JwNv1PgS4jbPOIfzwTqU06ufboAUuj+PhA4pW2 pzTzLDEUjkR3p7TVaJZiOpwsEzWA2GkkDP5/RhfLtCjg0Pvmg7nP9l5V1XnUEUT7xNl4 IUrYw70SD27ss/QRuOhG287TyeVrDg4MmJ7YkmbIa+LyDx+ysAuZzW4UeakTkqDuRw6A c/Th48zme7y0kzBbt49j/Ggh0ccVNKuL2Y7k2JUgEzydTYVX6Z2Fd479G0UgQvgboBlV ubrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=of5oPnfq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js11-20020a17090797cb00b0072b68e9bf3csi7753765ejc.972.2022.07.12.08.57.46; Tue, 12 Jul 2022 08:58:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=of5oPnfq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231146AbiGLPZP (ORCPT + 99 others); Tue, 12 Jul 2022 11:25:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232986AbiGLPY5 (ORCPT ); Tue, 12 Jul 2022 11:24:57 -0400 Received: from mail-m971.mail.163.com (mail-m971.mail.163.com [123.126.97.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 48ED15C9EE; Tue, 12 Jul 2022 08:24:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=G+z5b nYslAb/L5CvdEE281XrI0AtqzAgEbcezhR5z/g=; b=of5oPnfq0ElM4u3Gp0z1i H6x9dcdaHbpeBh69qyBYQnJumYC0pdTof2nv3tDiWNCBJI1Ds78hDK1D3AuCWwGF g8HTkld/63jjyU8LfwTJoKBk+FBMvPH37FIw2dWOHj67/lPR3/D+x2SS3tPRTbGy fjcETL9HHU3Fir0f7JuGiQ= Received: from localhost.localdomain (unknown [123.58.221.99]) by smtp1 (Coremail) with SMTP id GdxpCgDnQqXpkc1iayuaNw--.2084S2; Tue, 12 Jul 2022 23:23:24 +0800 (CST) From: williamsukatube@163.com To: linux-unionfs@vger.kernel.org, linux-kernel@vger.kernel.org Cc: miklos@szeredi.hu, William Dean , Hacash Robot Subject: [PATCH -next] ovl: clean up comparsions to NULL Date: Tue, 12 Jul 2022 23:23:18 +0800 Message-Id: <20220712152318.2649819-1-williamsukatube@163.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: GdxpCgDnQqXpkc1iayuaNw--.2084S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7AF4rKry3ur1xWFy3KFyUZFb_yoW8CFWUpF WxCa4rt34rX347ZF1SyF4q9Fy5X395GF47J348uwsFv395Ww4rAryjy3WjqF9rAFWrurWa vanYgry5Ja1kZF7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07b1GYLUUUUU= X-Originating-IP: [123.58.221.99] X-CM-SenderInfo: xzlozx5dpv3yxdwxuvi6rwjhhfrp/xtbB0Aw8g2EsrUTQrwAAs4 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: William Dean Clean up comparsions to NULL, simplify as follows: if (x == NULL) -> if (!x) Reported-by: Hacash Robot Signed-off-by: William Dean --- 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