Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3550621imu; Mon, 28 Jan 2019 06:51:59 -0800 (PST) X-Google-Smtp-Source: ALg8bN7zxbNO0d2xdUzAxIcM6aqSltL3S2yyoUu6Is7u9w9uGTg7lylCSCj1OpFZc8NHvLtmeHxN X-Received: by 2002:a17:902:4523:: with SMTP id m32mr21982144pld.53.1548687119338; Mon, 28 Jan 2019 06:51:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548687119; cv=none; d=google.com; s=arc-20160816; b=I26BaVQpdwsIOgmSvsM0m/bgwXX1jbzdlJ80a4PPSfeCqo/j/rr4/1Y0i2Pb0uUrVm sWccZ1eVvdBuPHIq6TzJAHYKaANfAi+WbVNI95x0Z8zlJs5en3TPRjp3TsaRe9sHuofg pDHMrKNQFiRywaZ66PFvR3l6JpUgngzr8K2kY+pZ0AStVjuMvpwv9eEb3MGbZWe0AJdD vWXG+9VmhMRmOnGHTaR8xh0wu8rKJ5d7/+hiISklpbM5NcRTPKAuyx3Mtw9Vo8kOK6MH jsBZB5sEzaiwxMfgQL/uc29z2BIrg8Av94qjFeEnmJkcH8SeuGWUus/YOdyrxAncdVEI H+8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=QbqKgVQpuBiySJrrXRXFZtM2Hoo8cjZ44d5iw9+nroA=; b=XLJczQyl4VhkCtwGw1GfgdfwjP9elsDPA7ZmrnnCPF2HQHMSEb+Wh3/1hLr6kiNoPk DIC5SB6y4mjJbBooxPtiL5Gx1L5+Ki7tfywbqTJ7pNV6jInKihT7WcHKA9SehUc3kBLM Al/hePRP8SPuRGaLDDKt/yTP/61p99LOr0K/PWC/aZKSF+9Y+ez1aBHynNjgLYxJbaT2 2e5e7yGbJM6foVnptqgv9kMwEOgWfGuIjOv5EmdmTMvajinfkRFuEHbL3k8S9tSFYiRy jwqL93HMDTN9SQa2WuK5dULIdup9g4IGrfA3AD/WUJGRE0oLWPUGTJ5dvkTNsek9PgfZ MKkw== 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 p17si32716753pfk.275.2019.01.28.06.51.44; Mon, 28 Jan 2019 06:51: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; 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 S1726829AbfA1Ov3 (ORCPT + 99 others); Mon, 28 Jan 2019 09:51:29 -0500 Received: from mx2.suse.de ([195.135.220.15]:57436 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726682AbfA1Ov3 (ORCPT ); Mon, 28 Jan 2019 09:51:29 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 582BDAEF3; Mon, 28 Jan 2019 14:51:28 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 287791E3FEF; Mon, 28 Jan 2019 15:51:28 +0100 (CET) Date: Mon, 28 Jan 2019 15:51:28 +0100 From: Jan Kara To: Liu Xiang Cc: jack@suse.com, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, liuxiang_1999@126.com Subject: Re: [PATCH] ext2: Remove redundant check for finding no group Message-ID: <20190128145128.GB5858@quack2.suse.cz> References: <1548424896-4692-1-git-send-email-liu.xiang6@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1548424896-4692-1-git-send-email-liu.xiang6@zte.com.cn> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 25-01-19 22:01:36, Liu Xiang wrote: > When best_desc keeps NULL, best_group keeps -1, too. So we can > return best_group directly. > > Signed-off-by: Liu Xiang Thanks for the patch! I've added it to my tree. Honza > --- > 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 > > -- Jan Kara SUSE Labs, CR