All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] mISDN: Mark local variable 'incomplete' as __maybe_unused in dsp_pipeline_build()
@ 2021-05-19 12:53 Zhen Lei
  2021-05-19 15:45 ` Leon Romanovsky
  0 siblings, 1 reply; 4+ messages in thread
From: Zhen Lei @ 2021-05-19 12:53 UTC (permalink / raw)
  To: Karsten Keil, netdev; +Cc: Zhen Lei

GCC reports the following warning with W=1:

drivers/isdn/mISDN/dsp_pipeline.c:221:6: warning:
 variable 'incomplete' set but not used [-Wunused-but-set-variable]
  221 |  int incomplete = 0, found = 0;
      |      ^~~~~~~~~~

This variable is used only when macro PIPELINE_DEBUG is defined.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 drivers/isdn/mISDN/dsp_pipeline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/mISDN/dsp_pipeline.c b/drivers/isdn/mISDN/dsp_pipeline.c
index 40588692cec7..6a31f6879da8 100644
--- a/drivers/isdn/mISDN/dsp_pipeline.c
+++ b/drivers/isdn/mISDN/dsp_pipeline.c
@@ -218,7 +218,7 @@ void dsp_pipeline_destroy(struct dsp_pipeline *pipeline)
 
 int dsp_pipeline_build(struct dsp_pipeline *pipeline, const char *cfg)
 {
-	int incomplete = 0, found = 0;
+	int __maybe_unused incomplete = 0, found = 0;
 	char *dup, *tok, *name, *args;
 	struct dsp_element_entry *entry, *n;
 	struct dsp_pipeline_entry *pipeline_entry;
-- 
2.25.1



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

* Re: [PATCH 1/1] mISDN: Mark local variable 'incomplete' as __maybe_unused in dsp_pipeline_build()
  2021-05-19 12:53 [PATCH 1/1] mISDN: Mark local variable 'incomplete' as __maybe_unused in dsp_pipeline_build() Zhen Lei
@ 2021-05-19 15:45 ` Leon Romanovsky
  2021-05-20  1:09   ` Leizhen (ThunderTown)
  0 siblings, 1 reply; 4+ messages in thread
From: Leon Romanovsky @ 2021-05-19 15:45 UTC (permalink / raw)
  To: Zhen Lei; +Cc: Karsten Keil, netdev

On Wed, May 19, 2021 at 08:53:52PM +0800, Zhen Lei wrote:
> GCC reports the following warning with W=1:
> 
> drivers/isdn/mISDN/dsp_pipeline.c:221:6: warning:
>  variable 'incomplete' set but not used [-Wunused-but-set-variable]
>   221 |  int incomplete = 0, found = 0;
>       |      ^~~~~~~~~~
> 
> This variable is used only when macro PIPELINE_DEBUG is defined.

That define is commented 13 years ago and can be seen as a dead code
that should be removed.

Thanks

> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> ---
>  drivers/isdn/mISDN/dsp_pipeline.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/isdn/mISDN/dsp_pipeline.c b/drivers/isdn/mISDN/dsp_pipeline.c
> index 40588692cec7..6a31f6879da8 100644
> --- a/drivers/isdn/mISDN/dsp_pipeline.c
> +++ b/drivers/isdn/mISDN/dsp_pipeline.c
> @@ -218,7 +218,7 @@ void dsp_pipeline_destroy(struct dsp_pipeline *pipeline)
>  
>  int dsp_pipeline_build(struct dsp_pipeline *pipeline, const char *cfg)
>  {
> -	int incomplete = 0, found = 0;
> +	int __maybe_unused incomplete = 0, found = 0;
>  	char *dup, *tok, *name, *args;
>  	struct dsp_element_entry *entry, *n;
>  	struct dsp_pipeline_entry *pipeline_entry;
> -- 
> 2.25.1
> 
> 

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

* Re: [PATCH 1/1] mISDN: Mark local variable 'incomplete' as __maybe_unused in dsp_pipeline_build()
  2021-05-19 15:45 ` Leon Romanovsky
@ 2021-05-20  1:09   ` Leizhen (ThunderTown)
  2021-05-20  1:24     ` Leizhen (ThunderTown)
  0 siblings, 1 reply; 4+ messages in thread
From: Leizhen (ThunderTown) @ 2021-05-20  1:09 UTC (permalink / raw)
  To: Leon Romanovsky; +Cc: Karsten Keil, netdev



On 2021/5/19 23:45, Leon Romanovsky wrote:
> On Wed, May 19, 2021 at 08:53:52PM +0800, Zhen Lei wrote:
>> GCC reports the following warning with W=1:
>>
>> drivers/isdn/mISDN/dsp_pipeline.c:221:6: warning:
>>  variable 'incomplete' set but not used [-Wunused-but-set-variable]
>>   221 |  int incomplete = 0, found = 0;
>>       |      ^~~~~~~~~~
>>
>> This variable is used only when macro PIPELINE_DEBUG is defined.
> 
> That define is commented 13 years ago and can be seen as a dead code
> that should be removed.

OK, I will remove it in V2. Actually, every time incomplete=1, a KERN_ERR message
is printed in advance. The only new information is the 'cfg'.

> 
> Thanks
> 
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
>> ---
>>  drivers/isdn/mISDN/dsp_pipeline.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/isdn/mISDN/dsp_pipeline.c b/drivers/isdn/mISDN/dsp_pipeline.c
>> index 40588692cec7..6a31f6879da8 100644
>> --- a/drivers/isdn/mISDN/dsp_pipeline.c
>> +++ b/drivers/isdn/mISDN/dsp_pipeline.c
>> @@ -218,7 +218,7 @@ void dsp_pipeline_destroy(struct dsp_pipeline *pipeline)
>>  
>>  int dsp_pipeline_build(struct dsp_pipeline *pipeline, const char *cfg)
>>  {
>> -	int incomplete = 0, found = 0;
>> +	int __maybe_unused incomplete = 0, found = 0;
>>  	char *dup, *tok, *name, *args;
>>  	struct dsp_element_entry *entry, *n;
>>  	struct dsp_pipeline_entry *pipeline_entry;
>> -- 
>> 2.25.1
>>
>>
> 
> .
> 


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

* Re: [PATCH 1/1] mISDN: Mark local variable 'incomplete' as __maybe_unused in dsp_pipeline_build()
  2021-05-20  1:09   ` Leizhen (ThunderTown)
@ 2021-05-20  1:24     ` Leizhen (ThunderTown)
  0 siblings, 0 replies; 4+ messages in thread
From: Leizhen (ThunderTown) @ 2021-05-20  1:24 UTC (permalink / raw)
  To: Leon Romanovsky; +Cc: Karsten Keil, netdev



On 2021/5/20 9:09, Leizhen (ThunderTown) wrote:
> 
> 
> On 2021/5/19 23:45, Leon Romanovsky wrote:
>> On Wed, May 19, 2021 at 08:53:52PM +0800, Zhen Lei wrote:
>>> GCC reports the following warning with W=1:
>>>
>>> drivers/isdn/mISDN/dsp_pipeline.c:221:6: warning:
>>>  variable 'incomplete' set but not used [-Wunused-but-set-variable]
>>>   221 |  int incomplete = 0, found = 0;
>>>       |      ^~~~~~~~~~
>>>
>>> This variable is used only when macro PIPELINE_DEBUG is defined.
>>
>> That define is commented 13 years ago and can be seen as a dead code
>> that should be removed.
> 
> OK, I will remove it in V2. Actually, every time incomplete=1, a KERN_ERR message
> is printed in advance. The only new information is the 'cfg'.

Wow, Do you mean remove all "#ifdef PIPELINE_DEBUG" debug information? I will clean them.

> 
>>
>> Thanks
>>
>>>
>>> Reported-by: Hulk Robot <hulkci@huawei.com>
>>> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
>>> ---
>>>  drivers/isdn/mISDN/dsp_pipeline.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/isdn/mISDN/dsp_pipeline.c b/drivers/isdn/mISDN/dsp_pipeline.c
>>> index 40588692cec7..6a31f6879da8 100644
>>> --- a/drivers/isdn/mISDN/dsp_pipeline.c
>>> +++ b/drivers/isdn/mISDN/dsp_pipeline.c
>>> @@ -218,7 +218,7 @@ void dsp_pipeline_destroy(struct dsp_pipeline *pipeline)
>>>  
>>>  int dsp_pipeline_build(struct dsp_pipeline *pipeline, const char *cfg)
>>>  {
>>> -	int incomplete = 0, found = 0;
>>> +	int __maybe_unused incomplete = 0, found = 0;
>>>  	char *dup, *tok, *name, *args;
>>>  	struct dsp_element_entry *entry, *n;
>>>  	struct dsp_pipeline_entry *pipeline_entry;
>>> -- 
>>> 2.25.1
>>>
>>>
>>
>> .
>>


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

end of thread, other threads:[~2021-05-20  1:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-19 12:53 [PATCH 1/1] mISDN: Mark local variable 'incomplete' as __maybe_unused in dsp_pipeline_build() Zhen Lei
2021-05-19 15:45 ` Leon Romanovsky
2021-05-20  1:09   ` Leizhen (ThunderTown)
2021-05-20  1:24     ` Leizhen (ThunderTown)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.