linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: erofs: Fix a unused variable 'arg' warning
@ 2018-09-19  2:16 zhong jiang
  2018-09-19  3:07 ` cgxu519
  0 siblings, 1 reply; 3+ messages in thread
From: zhong jiang @ 2018-09-19  2:16 UTC (permalink / raw)
  To: gregkh; +Cc: gaoxiang25, yuchao0, linux-erofs, linux-kernel

I find the following warning when compiling the kernel.

drivers/staging/erofs/super.c:195:6: warning: unused variable 'arg' [-Wunused-variable]
  int arg = 0;

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 drivers/staging/erofs/super.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c
index 6423592..c04313f 100644
--- a/drivers/staging/erofs/super.c
+++ b/drivers/staging/erofs/super.c
@@ -192,7 +192,9 @@ static int parse_options(struct super_block *sb, char *options)
 {
 	substring_t args[MAX_OPT_ARGS];
 	char *p;
+#ifdef CONFIG_EROFS_FAULT_INJECTION
 	int arg = 0;
+#endif
 
 	if (!options)
 		return 0;
-- 
1.7.12.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] staging: erofs: Fix a unused variable 'arg' warning
  2018-09-19  2:16 [PATCH] staging: erofs: Fix a unused variable 'arg' warning zhong jiang
@ 2018-09-19  3:07 ` cgxu519
  2018-09-19  3:16   ` zhong jiang
  0 siblings, 1 reply; 3+ messages in thread
From: cgxu519 @ 2018-09-19  3:07 UTC (permalink / raw)
  To: zhong jiang, gregkh; +Cc: gaoxiang25, yuchao0, linux-erofs, linux-kernel

On 09/19/2018 10:16 AM, zhong jiang wrote:
> I find the following warning when compiling the kernel.
>
> drivers/staging/erofs/super.c:195:6: warning: unused variable 'arg' [-Wunused-variable]
>    int arg = 0;
>
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> ---
>   drivers/staging/erofs/super.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c
> index 6423592..c04313f 100644
> --- a/drivers/staging/erofs/super.c
> +++ b/drivers/staging/erofs/super.c
> @@ -192,7 +192,9 @@ static int parse_options(struct super_block *sb, char *options)
>   {
>   	substring_t args[MAX_OPT_ARGS];
>   	char *p;
> +#ifdef CONFIG_EROFS_FAULT_INJECTION
>   	int arg = 0;
> +#endif
>   
>   	if (!options)
>   		return 0;

Hi,

The fix has already included in my patch series "staging: erofs: option 
validation for remount and some code cleanups",
so it will be fixed when the series merge into tree and we do not 
encourage surrounding the code with macro in option
parsing for this case.

Thanks,
Chengguang

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] staging: erofs: Fix a unused variable 'arg' warning
  2018-09-19  3:07 ` cgxu519
@ 2018-09-19  3:16   ` zhong jiang
  0 siblings, 0 replies; 3+ messages in thread
From: zhong jiang @ 2018-09-19  3:16 UTC (permalink / raw)
  To: cgxu519; +Cc: gregkh, gaoxiang25, yuchao0, linux-erofs, linux-kernel

On 2018/9/19 11:07, cgxu519 wrote:
> On 09/19/2018 10:16 AM, zhong jiang wrote:
>> I find the following warning when compiling the kernel.
>>
>> drivers/staging/erofs/super.c:195:6: warning: unused variable 'arg' [-Wunused-variable]
>>    int arg = 0;
>>
>> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
>> ---
>>   drivers/staging/erofs/super.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c
>> index 6423592..c04313f 100644
>> --- a/drivers/staging/erofs/super.c
>> +++ b/drivers/staging/erofs/super.c
>> @@ -192,7 +192,9 @@ static int parse_options(struct super_block *sb, char *options)
>>   {
>>       substring_t args[MAX_OPT_ARGS];
>>       char *p;
>> +#ifdef CONFIG_EROFS_FAULT_INJECTION
>>       int arg = 0;
>> +#endif
>>         if (!options)
>>           return 0;
>
> Hi,
>
> The fix has already included in my patch series "staging: erofs: option validation for remount and some code cleanups",
> so it will be fixed when the series merge into tree and we do not encourage surrounding the code with macro in option
> parsing for this case.
>
Fine.  Thank you for explaination.

Sincerely,
zhong jiang
> Thanks,
> Chengguang
>
> .
>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-09-19  3:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-19  2:16 [PATCH] staging: erofs: Fix a unused variable 'arg' warning zhong jiang
2018-09-19  3:07 ` cgxu519
2018-09-19  3:16   ` zhong jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).