From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="as2FB6qw"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="6yAxur9O" Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B22F7EA for ; Sat, 18 Nov 2023 08:41:47 -0800 (PST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 4764B1F381 for ; Sat, 18 Nov 2023 16:41:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1700325706; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8mwAY6+Os3c1dJ5jySPRd9x61Vf/doet5H/qvmK0KsY=; b=as2FB6qw2EaFJfU6cOwQgKMs7wjyXYeOR4qt/UuOVRTk9nvVJ6AMYhaBURuMfwFaYZmUMj o3vCka6sMGFwphLMdPX9hscVY5WT5EEWwKwWLBbPatf46bMxh21ZJZbgN1qfOXHfgphDOK C8aqtDMqr+6bTMSwqMwxJTw33SZOhOY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1700325706; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8mwAY6+Os3c1dJ5jySPRd9x61Vf/doet5H/qvmK0KsY=; b=6yAxur9O27jzhpoxveWOrVQep/E0pFCKC54mBfy0oBVyXAawX+Z74ERe2t8npTlpilesgq uOAbD3R1Z28Ux0DA== Received: from localhost.localdomain (colyli.tcp.ovpn1.nue.suse.de [10.163.16.22]) by relay2.suse.de (Postfix) with ESMTP id 91CA12D27D; Sat, 18 Nov 2023 16:41:40 +0000 (UTC) From: Coly Li To: linux-bcache@vger.kernel.org Cc: Coly Li Subject: [PATCH 2/2] bcache: avoid NULL checking to c->root in run_cache_set() Date: Sun, 19 Nov 2023 00:40:29 +0800 Message-Id: <20231118164029.9723-2-colyli@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20231118164029.9723-1-colyli@suse.de> References: <20231118164029.9723-1-colyli@suse.de> Precedence: bulk X-Mailing-List: linux-bcache@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Bar: +++++++++++++++++++++ Authentication-Results: smtp-out2.suse.de; dkim=none; dmarc=none; spf=softfail (smtp-out2.suse.de: 149.44.160.134 is neither permitted nor denied by domain of colyli@suse.de) smtp.mailfrom=colyli@suse.de X-Rspamd-Server: rspamd2 X-Spamd-Result: default: False [21.99 / 50.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; NEURAL_SPAM_SHORT(3.00)[1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(1.20)[suse.de]; BROKEN_CONTENT_TYPE(1.50)[]; R_SPF_SOFTFAIL(4.60)[~all:c]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MX_GOOD(-0.01)[]; RCPT_COUNT_TWO(0.00)[2]; MID_CONTAINS_FROM(1.00)[]; RWL_MAILSPIKE_GOOD(-1.00)[149.44.160.134:from]; NEURAL_SPAM_LONG(3.50)[1.000]; VIOLATED_DIRECT_SPF(3.50)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(2.20)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2] X-Spam-Score: 21.99 X-Rspamd-Queue-Id: 4764B1F381 In run_cache_set() after c->root returned from bch_btree_node_get(), it is checked by IS_ERR_OR_NULL(). Indeed it is unncessary to check NULL because bch_btree_node_get() will not return NULL pointer to caller. This patch replaces IS_ERR_OR_NULL() by IS_ERR() for the above reason. Signed-off-by: Coly Li --- drivers/md/bcache/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index c7ecc7058d77..bfe1685dbae5 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -2018,7 +2018,7 @@ static int run_cache_set(struct cache_set *c) c->root = bch_btree_node_get(c, NULL, k, j->btree_level, true, NULL); - if (IS_ERR_OR_NULL(c->root)) + if (IS_ERR(c->root)) goto err; list_del_init(&c->root->list); -- 2.35.3