Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4297486pxb; Thu, 14 Oct 2021 02:26:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx38r1mIA91WtjPPGW6OYEP8SvFrEfghlroSS4GaS3YPMIA9cHFBx9XjK8P7zC4VOxU7UIJ X-Received: by 2002:a05:6a00:140c:b0:44b:e251:fe13 with SMTP id l12-20020a056a00140c00b0044be251fe13mr4419379pfu.10.1634203600780; Thu, 14 Oct 2021 02:26:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634203600; cv=none; d=google.com; s=arc-20160816; b=0GNdskku0rpnO054akEUnZvLquNHidghSl0utiauXBtPjg0cM5MB6003Yv7b6Bt9Gy mivxnWlLoFkcpWhG/y6kPaQlckHFgWuVHzhXH8mJFvPcis/5rIk3c1dKJhfXbhTVCqcB JFbzWWf4mQUDMKJKqoBKSu+eks2pV+qX23M2nv8X/yRqcqBHuZDzlo3B32w/GRioZI/l ZKVCMMyGAfRGEzCqbhX8Py+UL+rPyLQ/REbgw8RsWUh2wpMdH8qr+/FcAyD3MyEMWoA6 anUWrADiKkufBSpGIMMCyOFsiPK+aRuwk9aqv3gnGOTHsiOYpobUPl2JDVhIcoi9dBKe jCOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=RFOdYQjzDv9lKUvJKboCo23r0L/XTwNAaieaO8QbCzY=; b=nkp2iL3XLGKtEo6jlNxJtnlWT+HbrUp09Zut/kFmrqlNnJlNFhDUSo9j7O+uISCh59 NYwKLf/pE9ujNT7Blf+SkEoQZiCtFTcdJvihg99BbevvjYK/yAhZKhXSSCwLvWMMbStP C0pX/PNrSzxQ26/OJYZdk8uZ13Yo4fwI3GbUoWYsdFmOQn4YG9abcgfOepXbk1Wr2Mmo 1XNzZImipRgL7L8DsHfPTQtHWgQYxdcqyKT7ikG3f0HxOYMCUYth9qMP410Tz3n/7dhw +hv44oQ34rMUFhuzh0DVDEYSJIh8dTVMhT/u0h/HHI0ZBrhPQ0Ve7Y8P4qQrrwGjkxkl O0hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=lPxvvFIj; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h33si2629470pjd.123.2021.10.14.02.26.09; Thu, 14 Oct 2021 02:26:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=lPxvvFIj; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229984AbhJNJ2L (ORCPT + 99 others); Thu, 14 Oct 2021 05:28:11 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:41964 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbhJNJ2K (ORCPT ); Thu, 14 Oct 2021 05:28:10 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 3A4EA1FD29; Thu, 14 Oct 2021 09:26:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1634203565; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RFOdYQjzDv9lKUvJKboCo23r0L/XTwNAaieaO8QbCzY=; b=lPxvvFIjUfVNHyO0Mk2zC16+PLVqSeQLVgSSAx4M2H1+hXVTuop+RuupG4auHz9Ey9Ix5V tU+hAXdDoK74y3HWiW6Ua+zRRJ6Kn+0/S3fR3ttQDJwoMqmhuq70ZVGReGJHT4smT+BAEX FrXogTsztG/KeCqDrZ6NbSvpAXopE8k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1634203565; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RFOdYQjzDv9lKUvJKboCo23r0L/XTwNAaieaO8QbCzY=; b=6TUWxJUwwf94kokRjlC2HXQBh+uij3gFkgmi/LsLkZyvDTg6Tt8cuIvNO9PxUfYczmqgBM mCsDiVobQVkC3HCg== Received: from quack2.suse.cz (unknown [10.100.224.230]) by relay2.suse.de (Postfix) with ESMTP id AD2B9A3B84; Thu, 14 Oct 2021 09:26:04 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 6C7BA1E0C03; Thu, 14 Oct 2021 11:26:04 +0200 (CEST) Date: Thu, 14 Oct 2021 11:26:04 +0200 From: Jan Kara To: Austin Kim Cc: tytso@mit.edu, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, austin.kim@lge.com Subject: Re: [PATCH] ext4: remove an unused variable warning with CONFIG_QUOTA=n Message-ID: <20211014092604.GC15931@quack2.suse.cz> References: <20210824034929.GA13415@raspberrypi> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210824034929.GA13415@raspberrypi> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue 24-08-21 04:49:29, Austin Kim wrote: > The 'enable_quota' variable is only used in an CONFIG_QUOTA. > With CONFIG_QUOTA=n, compiler causes a harmless warning: > > fs/ext4/super.c: In function ‘ext4_remount’: > fs/ext4/super.c:5840:6: warning: variable ‘enable_quota’ set but not used > [-Wunused-but-set-variable] > int enable_quota = 0; > ^~~~~ > > Move 'enable_quota' into the same #ifdef CONFIG_QUOTA block > to remove an unused variable warning. > > Signed-off-by: Austin Kim I guess this has fallen through the cracks. The fix looks good to me. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/ext4/super.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/fs/ext4/super.c b/fs/ext4/super.c > index 6b03e4281f6f..6adb570f4b31 100644 > --- a/fs/ext4/super.c > +++ b/fs/ext4/super.c > @@ -5845,10 +5845,10 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) > struct ext4_sb_info *sbi = EXT4_SB(sb); > unsigned long old_sb_flags, vfs_flags; > struct ext4_mount_options old_opts; > - int enable_quota = 0; > ext4_group_t g; > int err = 0; > #ifdef CONFIG_QUOTA > + int enable_quota = 0; > int i, j; > char *to_free[EXT4_MAXQUOTAS]; > #endif > @@ -6053,7 +6053,9 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) > err = -EROFS; > goto restore_opts; > } > +#ifdef CONFIG_QUOTA > enable_quota = 1; > +#endif > } > } > > -- > 2.20.1 > -- Jan Kara SUSE Labs, CR