Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp717373ybc; Tue, 19 Nov 2019 08:09:58 -0800 (PST) X-Google-Smtp-Source: APXvYqyOrGJYspxZ3Z6AhMQrAlwSJ4HZO6eueySUuzwWC9fJde9tq4azNKmmiyuoO9wnZTRwh5pN X-Received: by 2002:a17:906:bc9:: with SMTP id y9mr35719543ejg.64.1574179798052; Tue, 19 Nov 2019 08:09:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574179798; cv=none; d=google.com; s=arc-20160816; b=mnwxCQlvrHMpcc2YBnEzLyZppAbeinMtbBgsEs7gbeINjd4ZywpbxAFr2FJEsl4Ijh /3M99bI34AQ08OtnfnmElw7ldiU8V0ZX+ervQlo5273pSyobOrpTm9Cycsw0iR/I71gR d2PHl4rVPbyhOBcxROPpmJBpt8db8vI1pRl8xzEuAuTFaaXfGuUx2rRp0HM7BHtP9C6/ k78HlZUdcErhYwH+p8rYX32VIuZCEo3NiretG2yX2o4WbkDJAWSWs734Lt/aQ0SOW5lw 02olfQ9061gi4RMYprPY35CgtovNpvL9TqNhrwem7SDH8JkyeJNYUuRFv0705vo5w/1D MY2w== 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=vWo4uvNUwlHlIL6grp3HlFVJJG252xljfEYJ4DKcGBQ=; b=sgjOMIpjuLzhTaII5at+UlcXfX9SOgUYZn5Ok8dZjWezAvhwMnevU4rl/4nNUgkJ2y vOqkP0RSYKMuNY6rDHtqbcm89d4YVWMy0BRRgowrbrfX4Q8A0qNiGH/5ha1BTihI1mfP 5PPjov16SdEC3ddHzqyKOUzLFktGecc6dgygre0p+/L/L3047RO2ZUIY7KTsY8OLaQ1L nMSqBdLCjpbFodsC1XNjlWgCnDSgvO8pYrIKA5GZNM7chaQ5JujWHOkhGJVNPS831kg8 HKoyItrUvqadRmlKnemCgHA4eJfhnSdJ9tv0ZhAct0oNqkPLZ1bPH1pG5pe10rJLG2IK T3Kg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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 r12si14468814ejx.217.2019.11.19.08.09.21; Tue, 19 Nov 2019 08:09:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728384AbfKSQFE (ORCPT + 99 others); Tue, 19 Nov 2019 11:05:04 -0500 Received: from mx2.suse.de ([195.135.220.15]:47304 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727509AbfKSQFE (ORCPT ); Tue, 19 Nov 2019 11:05:04 -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 5DEF0BAAE; Tue, 19 Nov 2019 16:05:02 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id D19E11E47E5; Tue, 19 Nov 2019 17:05:01 +0100 (CET) Date: Tue, 19 Nov 2019 17:05:01 +0100 From: Jan Kara To: Chengguang Xu Cc: jack@suse.com, linux-ext4@vger.kernel.org Subject: Re: [PATCH] ext2: code cleanup for descriptor_loc() Message-ID: <20191119160501.GB2440@quack2.suse.cz> References: <20191115224900.2613-1-cgxu519@mykernel.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191115224900.2613-1-cgxu519@mykernel.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Sat 16-11-19 06:49:00, Chengguang Xu wrote: > Code cleanup by removing unnecessary variable > in descriptor_loc(). > > Signed-off-by: Chengguang Xu Thanks! I've added the patch to my tree. Honza > --- > fs/ext2/super.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/fs/ext2/super.c b/fs/ext2/super.c > index 30c630d73f0f..bef607d5db28 100644 > --- a/fs/ext2/super.c > +++ b/fs/ext2/super.c > @@ -806,7 +806,6 @@ static unsigned long descriptor_loc(struct super_block *sb, > { > struct ext2_sb_info *sbi = EXT2_SB(sb); > unsigned long bg, first_meta_bg; > - int has_super = 0; > > first_meta_bg = le32_to_cpu(sbi->s_es->s_first_meta_bg); > > @@ -814,10 +813,8 @@ static unsigned long descriptor_loc(struct super_block *sb, > nr < first_meta_bg) > return (logic_sb_block + nr + 1); > bg = sbi->s_desc_per_block * nr; > - if (ext2_bg_has_super(sb, bg)) > - has_super = 1; > > - return ext2_group_first_block_no(sb, bg) + has_super; > + return ext2_group_first_block_no(sb, bg) + ext2_bg_has_super(sb, bg); > } > > static int ext2_fill_super(struct super_block *sb, void *data, int silent) > -- > 2.21.0 > > > -- Jan Kara SUSE Labs, CR