mISDN: Mark local variable 'incomplete' as __maybe_unused in dsp_pipeline_build()
Subsystems (2)
PATCH 1/1 mISDN: Mark local variable 'incomplete' as __maybe_unused in dsp_pipeline_build()
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.
--- drivers/isdn/mISDN/dsp_pipeline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/isdn/mISDN/dsp_pipeline.c +1 -1
@@ -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;
Signature · 1 line
2.25.1
Quoted 8 lines · 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_DEBUGis defined.
That define is commented 13 years ago and can be seen as a dead code that should be removed.
Thanks
Quoted 24 lines
Reported-by Hulk Robot <[email protected]>Signed-off-by Zhen Lei <[email protected]>--- drivers/isdn/mISDN/dsp_pipeline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/isdn/mISDN/dsp_pipeline.c +1
-1@@ -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;Signature · 1 line
2.25.1
Quoted 8 lines · Leon Romanovsky
Quoted 7 lines · 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; | ^~~~~~~~~~
Quoted 4 lines
Quoted 1 line
This variable is used only when macro
PIPELINE_DEBUGis 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'.
Quoted 30 lines
Thanks
Quoted 24 lines
Reported-by Hulk Robot <[email protected]>Signed-off-by Zhen Lei <[email protected]>--- drivers/isdn/mISDN/dsp_pipeline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/isdn/mISDN/dsp_pipeline.c +1
-1@@ -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;Signature · 1 line
2.25.1.
Quoted 11 lines · Leizhen (ThunderTown)
Quoted 8 lines · Leon Romanovsky
Quoted 7 lines · 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; | ^~~~~~~~~~
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
This variable is used only when macro
PIPELINE_DEBUGis 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_ERRmessage 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.
Quoted 31 lines
Quoted 31 lines
Thanks
Quoted 24 lines
Reported-by Hulk Robot <[email protected]>Signed-off-by Zhen Lei <[email protected]>--- drivers/isdn/mISDN/dsp_pipeline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/isdn/mISDN/dsp_pipeline.c +1
-1@@ -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;Signature · 1 line
2.25.1.