suppress warning: ‘quotatypes’ defined but not used
Hello,
There is unused (in some cases) pointer in dquot.c fs/quota/dquot.c:135: warning: ‘quotatypes’ defined but not used
which is referenced only when
#ifdef CONFIG_QUOTA_DEBUG or #ifdef CONFIG_PRINT_QUOTA_WARNING
My proposal is to wrap declaration in "if defined(CONFIG_QUOTA_DEBUG) || defined(CONFIG_PRINT_QUOTA_WARNING) ..."?
fs/quota/dquot.c +4 -1
@@ -132,7 +132,10 @@ static __cacheline_aligned_in_smp DEFINE_SPINLOCK(dq_state_lock);__cacheline_aligned_in_smp DEFINE_SPINLOCK (dq_data_lock );EXPORT_SYMBOL (dq_data_lock); -static char *quotatypes[] =INITQFNAMES ; +#if defined(CONFIG_QUOTA_DEBUG ) || defined(CONFIG_PRINT_QUOTA_WARNING ) +static char *quotatypes[] =INITQFNAMES ; +#endif +static struct quota_format_type *quota_formats;/* List of registered formats */ static struct quota_module_name module_names[] =INIT_QUOTA_MODULE_NAMES ;
Quoted 8 lines · Sergey Senozhatsky
Hello,
There is unused (in some cases) pointer indquot.cfs/quota/dquot.c:135: warning: ‘quotatypes’ defined but not usedwhich is referenced only when
#ifdefCONFIG_QUOTA_DEBUGor #ifdefCONFIG_PRINT_QUOTA_WARNINGMy proposal is to wrap declaration in "if
defined(CONFIG_QUOTA_DEBUG)||defined(CONFIG_PRINT_QUOTA_WARNING)..."?
The patch is fine. Could you please add your Signed-off-by to the patch
(see Documentation/SubmittingPatches in case you don't know what it is). Thanks.
Honza
Quoted 18 lines
fs/quota/dquot.c +4
-1@@ -132,7 +132,10 @@ static __cacheline_aligned_in_smp DEFINE_SPINLOCK(dq_state_lock);__cacheline_aligned_in_smp DEFINE_SPINLOCK (dq_data_lock );EXPORT_SYMBOL (dq_data_lock); -static char *quotatypes[] =INITQFNAMES ; +#if defined(CONFIG_QUOTA_DEBUG ) || defined(CONFIG_PRINT_QUOTA_WARNING ) +static char *quotatypes[] =INITQFNAMES ; +#endif +static struct quota_format_type *quota_formats;/* List of registered formats */ static struct quota_module_name module_names[] =INIT_QUOTA_MODULE_NAMES ;
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Hello,
Quoted 5 lines · Jan Kara
The patch is fine. Could you please add your Signed-off-by to the patch (see
Documentation/SubmittingPatchesin case you don't know what it is). Thanks.Honza
My editor truncated /* List of registered formats */ line in the patch. So I resent it (titled as (resent)). Sorry for inattention.
Sergey