Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp568077imu; Fri, 25 Jan 2019 07:11:04 -0800 (PST) X-Google-Smtp-Source: ALg8bN5NMgVY+PcbwiFR1Bq+pfFy4IxYZAokIPX/ZpE4wosY3MSgOaj0+XxLogt5/5IVbfJtQgnc X-Received: by 2002:a17:902:aa82:: with SMTP id d2mr11398293plr.153.1548429064324; Fri, 25 Jan 2019 07:11:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548429064; cv=none; d=google.com; s=arc-20160816; b=kTtPPLPu9Qw4T4lu9rBmKBXlbu5arJXYf8YjktNA2xw9+kMgEctFPqj8gev8HSJFVC /Cf8w38RthZi+7ITI1bLUIsb0LT3j0D/a5SpyJSVljgbWCZvRdI0YWfkebhW4bE5a2Qm D+LyO99/sXD+aMYEVN/x9GtfIrvLX+p5Mf0GI+61hJ6GhBrNivTH4perySPNDEdOcaEV 8k2AyH4JE4cuQeqnaI7esPb0XWQoXwKyWw+fts3GdyTlJZjwTKzTX8/BRTKvrjqpLlbZ 8q0EQr+cciHDB32o2n3VgDOu5s3MU+e/TqjGhLHLGbRveC7UxblJgDAoXn4g1q4Q1AJx h8eQ== 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; bh=l/h4XEoFG5A5v2PpD9KslKYDW/MxjHedstayhtR4AAM=; b=mAKzu14OWXdWHZd0dR9OdPlrD3z4DN/8GURFNrOY3FSP46H8G224VwN6RoibQ7RIVB TfiykdTnZD6JLI1/hAqUQWQVvBKMHrERFDUwKAQq3dAcNFSQO0/1D3SMqkvQxN5Wh3pk iZaAmdKWq8oxpiM0ACmOQqKaqqLILUoWSdhYUy8PS8uC1aouhiX8jQDtLRbjt9n1EiIa Ju37Kbys1yXTD0F1Qdtx0gR1Uucc5gvia6gkoAaQgCv5H3OyxC/dBoJk3SKSLyXoeCMO RkTWVoNxopr7IalEbIoasq+voNV2NGA1DJUcpuQW7nFRq89NqyGm34evp3oPDfuvGV92 DUZg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h88si25796243pfa.49.2019.01.25.07.10.49; Fri, 25 Jan 2019 07:11:04 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726921AbfAYPJv (ORCPT + 99 others); Fri, 25 Jan 2019 10:09:51 -0500 Received: from smtprz14.163.net ([106.3.154.247]:57544 "EHLO smtp.tom.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726335AbfAYPJv (ORCPT ); Fri, 25 Jan 2019 10:09:51 -0500 Received: from 172.25.16.148 (unknown [172.25.16.148]) by freemail01.tom.com (Postfix) with ESMTP id B97EE1C819F4 for ; Fri, 25 Jan 2019 22:01:43 +0800 (CST) Received: from 172.25.16.90 (HELO smtp.tom.com) ([172.25.16.90]) by localhost (TOM SMTP Server) with SMTP ID 1338532507 for ; Fri, 25 Jan 2019 22:01:43 +0800 (CST) Received: from antispam1.tom.com (unknown [172.25.16.55]) by freemail01.tom.com (Postfix) with ESMTP id B1DA11C819CF for ; Fri, 25 Jan 2019 22:01:43 +0800 (CST) Received: from antispam1.tom.com (antispam1.tom.com [127.0.0.1]) by antispam1.tom.com (Postfix) with ESMTP id B25D310016FE for ; Fri, 25 Jan 2019 22:01:43 +0800 (CST) X-Virus-Scanned: Debian amavisd-new at antispam1.tom.com Received: from antispam1.tom.com ([127.0.0.1]) by antispam1.tom.com (antispam1.tom.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6NzsFu3mwfu9 for ; Fri, 25 Jan 2019 22:01:43 +0800 (CST) Received: from localhost (unknown [222.209.19.163]) by antispam1.tom.com (Postfix) with ESMTPA id A391C1000F35; Fri, 25 Jan 2019 22:01:42 +0800 (CST) From: Liu Xiang To: jack@suse.com Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, liuxiang_1999@126.com, Liu Xiang Subject: [PATCH] ext2: Remove redundant check for finding no group Date: Fri, 25 Jan 2019 22:01:36 +0800 Message-Id: <1548424896-4692-1-git-send-email-liu.xiang6@zte.com.cn> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When best_desc keeps NULL, best_group keeps -1, too. So we can return best_group directly. Signed-off-by: Liu Xiang --- fs/ext2/ialloc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c index 5c3d7b7..a0c5ea9 100644 --- a/fs/ext2/ialloc.c +++ b/fs/ext2/ialloc.c @@ -222,8 +222,6 @@ static int find_group_dir(struct super_block *sb, struct inode *parent) best_desc = desc; } } - if (!best_desc) - return -1; return best_group; } -- 1.9.1