]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
fs/quota: erase unused but set variable warning
authorJiang Biao <benbjiang@tencent.com>
Wed, 24 Apr 2019 00:58:57 +0000 (08:58 +0800)
committerJan Kara <jack@suse.cz>
Thu, 25 Apr 2019 15:04:43 +0000 (17:04 +0200)
Local variable *reserved* of remove_dquot_ref() is only used if
define CONFIG_QUOTA_DEBUG, but not ebraced in CONFIG_QUOTA_DEBUG
macro, which leads to unused-but-set-variable warning when compiling.

This patch ebrace it into CONFIG_QUOTA_DEBUG macro like what is done
in add_dquot_ref().

Signed-off-by: Jiang Biao <benbjiang@tencent.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/quota/dquot.c

index d2f2972b33db83bf62f5b9275f09bea72eee26f6..67e534dbfc0e87db79f9151da99f77a24b487fd7 100644 (file)
@@ -1050,7 +1050,9 @@ static void remove_dquot_ref(struct super_block *sb, int type,
                struct list_head *tofree_head)
 {
        struct inode *inode;
+#ifdef CONFIG_QUOTA_DEBUG
        int reserved = 0;
+#endif
 
        spin_lock(&sb->s_inode_list_lock);
        list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
@@ -1062,8 +1064,10 @@ static void remove_dquot_ref(struct super_block *sb, int type,
                 */
                spin_lock(&dq_data_lock);
                if (!IS_NOQUOTA(inode)) {
+#ifdef CONFIG_QUOTA_DEBUG
                        if (unlikely(inode_get_rsv_space(inode) > 0))
                                reserved = 1;
+#endif
                        remove_inode_dquot_ref(inode, type, tofree_head);
                }
                spin_unlock(&dq_data_lock);