Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1999134yba; Mon, 15 Apr 2019 02:51:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVl5QmUfFHQHQ59fpb2oUDjGmdpxIa9YPASnJoqoskP/lDK90snbmnuBsJWiAJPT6zM6qn X-Received: by 2002:aa7:9116:: with SMTP id 22mr74856154pfh.165.1555321900432; Mon, 15 Apr 2019 02:51:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555321900; cv=none; d=google.com; s=arc-20160816; b=TFbazpmXVgCj8N/4WiJMsmPscYTf3+cs3qp2oF2uZulqZMFxHNubXpSQbNvc4JRFGC Gkw2G4EVjnJ2CO5X8DPDpza2pxtpKRWYJoNWmh6foL6vjP6ZJOm68Bh/Decr2NlEpibG 0AcBMqrU9UXLEFo9+zZ4RfWYSNJVDrD7Fq6rMJwmgjy6hyMyWlVfv7xU9gz33TZzMT7F coCbktU07v/wj9r/Y469Ir8KIbueqJ+GwJkBo4Y+3zNJBuuTVL6C3p2XUylq4kZUinKS 2sehUjMNEB+0iUWJ+mjHIY3/8D5xdFyYT2qfyWlYC2cR5+ncTfsGtClazHYeMltfodmS ozlQ== 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=fHC6P+Jgl5reETo7VjDDczjIWwH/gob8cnDLp+nOa5s=; b=pW5Xh+hUGaDZwtTJMWjmVx8RIfpOKP3o7yfhVoMDBCQV3Q9S4+iyFkDrdfSJ5yhWeE kgrQ8sc/9eE9DUYYCDOivdOdGyq7HpI7glEv7WiBrfm3ypFWUg3qQNEiRoj0eb4lk7lP Di7lEbeU/TuImrb4FAV0tCtzbzAfunpj6DHZxbaaMpV9uFOfSRPS/IOqaYksjlEESGFO 9LN9ByEHMwoqYFbNjl1t4hp7UPP3sU4JohtfsVv2CPJAmNnJQpUDC3gLwRZw2ay/mRSs RaEIeJL890q3FYZ1cR4bs0+AsAb37kq6VyRnPRxMl4x4aqlWl8hyYplfXJ9QkhSWzrh7 VD4g== 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 a17si2916341pgd.274.2019.04.15.02.51.23; Mon, 15 Apr 2019 02:51:40 -0700 (PDT) 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 S1726700AbfDOJuf (ORCPT + 99 others); Mon, 15 Apr 2019 05:50:35 -0400 Received: from mx2.suse.de ([195.135.220.15]:57758 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726313AbfDOJuf (ORCPT ); Mon, 15 Apr 2019 05:50:35 -0400 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 5D200B025; Mon, 15 Apr 2019 09:50:34 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 074BC1E42AA; Mon, 15 Apr 2019 11:50:34 +0200 (CEST) Date: Mon, 15 Apr 2019 11:50:34 +0200 From: Jan Kara To: Chengguang Xu Cc: jack@suse.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] quota: remvoe redundant variable assignment Message-ID: <20190415095033.GB13684@quack2.suse.cz> References: <20190414135855.2536-1-cgxu519@gmx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190414135855.2536-1-cgxu519@gmx.com> 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 Sun 14-04-19 21:58:55, Chengguang Xu wrote: > The assignment of variable ret is redundant because the > value of ret is 0 after calling v2_read_header() in normal > case. > > Signed-off-by: Chengguang Xu Thanks for the patch. Yes, you are correct the assignment is redundant but this way it is more obvious what we're going to return and there are also less chances we'll break the logic when adding some code using 'ret' in the middle of v2_read_file_info(). Honza > --- > fs/quota/quota_v2.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/fs/quota/quota_v2.c b/fs/quota/quota_v2.c > index a73e5b34db41..25d36607be6e 100644 > --- a/fs/quota/quota_v2.c > +++ b/fs/quota/quota_v2.c > @@ -158,7 +158,6 @@ static int v2_read_file_info(struct super_block *sb, int type) > qinfo->dqi_entry_size = sizeof(struct v2r1_disk_dqblk); > qinfo->dqi_ops = &v2r1_qtree_ops; > } > - ret = 0; > out: > up_read(&dqopt->dqio_sem); > return ret; > -- > 2.17.2 > > -- Jan Kara SUSE Labs, CR