Received: by 10.223.176.5 with SMTP id f5csp535195wra; Tue, 6 Feb 2018 03:17:59 -0800 (PST) X-Google-Smtp-Source: AH8x225kdT93g5FdCcBx4mmsEPK/5endRsv8y07bygC8rm9qKW27H46EWOxZFEfuaga/gfG1+Mdx X-Received: by 10.98.242.2 with SMTP id m2mr2130768pfh.102.1517915879233; Tue, 06 Feb 2018 03:17:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517915879; cv=none; d=google.com; s=arc-20160816; b=olPakHu7PTXQjXognQWV5at3H9T3zWkQjVBPSuU4DPd4/kah7PgXHBaSUm+sQTNNcC lAEiQA8TZzbfrpq0LcZsfNtw0B78iYydLpJXaEZwvwFEZ4ooixeSBrw/X13SQLM435ez oArL+a7doKLZcQvGp2f6RhEnwMU4Qwff0kbFMiZ3hYG1SwPyIiSnjCYgyEYVVFbMu1DL 93ErE9apXkguMOcjKaHGAILfB+8x/K9tdKojCAeS9UMaI+AamG0UuJ/53X/wMbWMVEr4 470tBUYt3pmZvBOm7//yRUSAtACmC1PnOxscxv8ogsPuhIPkPiTOFMUkimJZg1OWb/sW uq8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=2kEux+qI5ans3BIZIIh5f9AHZ2USik8rJakwzritUSw=; b=Iq77aaoR0hc4tAlbr8fsO9SNwzYvPaO6GbjwTZuPjmFD8Ugu4GF5OEPj+n98qgf4k8 IHtut18/JkQ3/oTbPr++/Rv9Nx31ATC1Yvox4E6cVv+wWFxdJvtrB0q9U2r4b4k7yfMs 7gJKoCgZQaTxATVkyA686v+USEZIwl7jtXkY4fjU+M3UBNAX/BOPCn6Dz4y9OpDqBnbx 4fMSJ5l0AZgll00tGufgQFRBNmHMAzW7j7HwNUq5M05p29MqUR3ELKn1GNZ5k35guWkf p+BzfPztFf424NMxweujcomUiJx5H+XnrA/8etQukWy0imvNf7RaRoA387x477NFEYsB gmbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tibhqZ2r; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y128si2110335pfy.110.2018.02.06.03.17.44; Tue, 06 Feb 2018 03:17:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tibhqZ2r; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752647AbeBFLPs (ORCPT + 99 others); Tue, 6 Feb 2018 06:15:48 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:37048 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752263AbeBFLPk (ORCPT ); Tue, 6 Feb 2018 06:15:40 -0500 Received: by mail-pf0-f194.google.com with SMTP id p1so450816pfh.4; Tue, 06 Feb 2018 03:15:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=2kEux+qI5ans3BIZIIh5f9AHZ2USik8rJakwzritUSw=; b=tibhqZ2rriN/c+NJKNYI1FmsSDaXr6PJgSb6ilnt87H/5T2G2iqGvwEDRPA+dyPGX9 M31h3KSdr8QzHpORsqYb+GZQiM4uGRFjOcETZiBNi+OwDY0KsGmeLP72Qk1UJOUiOONc O03ZqMDdA+QPN2zQjHwqIdszD9vkQD4NdVeyaFHvQItWvj+vsw7VXSsfmyJ0a7SltSIv 52vCfuXZRtQ8QZ30xOKj3CvOyIhJnljK0pROZAtU26ULQrfgctlGl9L9MhkrJ6R6nbuV BVomKBvuuoEHW9cCr1G897m7vEvmNjU+GDUrSXWEW/RmYbfcvMI5l5d1NSVD0Gq5NqwD MgKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=2kEux+qI5ans3BIZIIh5f9AHZ2USik8rJakwzritUSw=; b=eQYf0fjpf/xmOSOl182WSURJCzd+He0xrdMXpKd+OyonsLx9KeFi5w/897Sm/0EYL2 LbWIx36P9m+rBdnWm06VCfV8W+2faKCuSt/DiLo5Y8SXJYEk44jZNacSQZZPGiAAv4ue EctnHl6bEMdKV4lxGA1jfVrHiZX2lutOZ6ZrKD8QPMBLL2DeoZ/X7DWWL0ePOIxf8+si XxsAxaz69Jn8JpvDWs34myjO4YpejZIwGU591nWHrwN8IY7Yz0Kaig4jyUgOgBmcijYS jCVYHBRi9ljnRbH/uF/t5XBX++voSHEQ00nKW69d2gGvo2p/nqZ+huCjXagecja79Va3 efCg== X-Gm-Message-State: APf1xPDUvjTLSTHp3AgIfXe5fCpfctsFxw2Cc2bPy1FKb6gKXhOlQ+wZ OMjUmIJsXZBvGamWwIdpTk2bIrIB X-Received: by 10.99.42.14 with SMTP id q14mr1645006pgq.183.1517915740252; Tue, 06 Feb 2018 03:15:40 -0800 (PST) Received: from linux-zmni.apac.novell.com ([45.122.156.254]) by smtp.gmail.com with ESMTPSA id w13sm17034292pfi.112.2018.02.06.03.15.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Feb 2018 03:15:39 -0800 (PST) From: Sean Fu To: tytso@mit.edu Cc: adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, Sean Fu Subject: [PATCH] ext4: Remove unnecessary NULL checks in ext4. Date: Tue, 6 Feb 2018 19:15:30 +0800 Message-Id: <1517915730-11198-1-git-send-email-fxinrong@gmail.com> X-Mailer: git-send-email 2.6.2 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org NULL check is done in kmem_cache_destroy. So remove NULL checks in ext4. Signed-off-by: Sean Fu --- fs/ext4/extents_status.c | 3 +-- fs/ext4/mballoc.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c index 763ef18..c4e6fb1 100644 --- a/fs/ext4/extents_status.c +++ b/fs/ext4/extents_status.c @@ -162,8 +162,7 @@ int __init ext4_init_es(void) void ext4_exit_es(void) { - if (ext4_es_cachep) - kmem_cache_destroy(ext4_es_cachep); + kmem_cache_destroy(ext4_es_cachep); } void ext4_es_init_tree(struct ext4_es_tree *tree) diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index d9f8b90a..4fd1349 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -2549,8 +2549,7 @@ static void ext4_groupinfo_destroy_slabs(void) int i; for (i = 0; i < NR_GRPINFO_CACHES; i++) { - if (ext4_groupinfo_caches[i]) - kmem_cache_destroy(ext4_groupinfo_caches[i]); + kmem_cache_destroy(ext4_groupinfo_caches[i]); ext4_groupinfo_caches[i] = NULL; } } -- 2.6.2