staging: greybus: fix warnings reported by checkpatch
cover staging: greybus: fix warnings reported by checkpatch
The first patch corrects a typo in a comment. The second patch fixes 'void function return statements are not generally useful' warning.
Jaehee Park (2):
staging: greybus: correct typo in comment 'Atleast' to 'At least'
staging: greybus: remove return in an empty void function
drivers/staging/greybus/arche-apb-ctrl.c | 2 +- drivers/staging/greybus/audio_codec.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
Signature · 1 line
2.25.1
PATCH 1/2 staging: greybus: correct typo in comment 'Atleast' to 'At least'
Correct spelling typo.
--- drivers/staging/greybus/arche-apb-ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/greybus/arche-apb-ctrl.c +1 -1
@@ -445,7 +445,7 @@ static int __maybe_unused arche_apb_ctrl_suspend(struct device *dev)static int __maybe_unused arche_apb_ctrl_resume (struct device *dev) {/* -* Atleast for ES2 we have to meet the delay requirement between +* At least for ES2 we have to meet the delay requirement between * unipro switch and AP bridge init, depending on whether bridge is in * OFF state or standby state. *
Signature · 1 line
2.25.1
PATCH 2/2 staging: greybus: remove return in an empty void function
In reply to Jaehee ParkIssue found by checkpatch:
WARNING: void function return statements are not generally useful
--- drivers/staging/greybus/audio_codec.c | 1 - 1 file changed, 1 deletion(-)
drivers/staging/greybus/audio_codec.c +0 -1
@@ -1032,7 +1032,6 @@ static int gbcodec_probe(struct snd_soc_component *comp)static void gbcodec_remove (struct snd_soc_component *comp) {/* Empty function for now */ -return ; } static int gbcodec_write(struct snd_soc_component *comp, unsigned int reg,
Signature · 1 line
2.25.1
Re: [PATCH 2/2] staging: greybus: remove return in an empty void function
Quoted 2 lines · Jaehee Park
Issue found by checkpatch:
WARNING: void function return statements are not generally useful
Even for a simple change, it wouldbe better to follow the model that the subject line should concisely orient the reader (eg "remove unneeded return") and the log message should give a more complete description. Simply repeating what checkpatch tells you is rarely a good idea. It says what the problem is in a general way, whereas you should be explaining the reasoning behind your fix in a specific case. Here you could say that an empty function with void return type does not need an explicit return, and that the problem was detected with checkpatch.
julia
Quoted 23 lines
Signed-off-by Jaehee Park <[email protected]>--- drivers/staging/greybus/audio_codec.c | 1 - 1 file changed, 1 deletion(-)drivers/staging/greybus/audio_codec.c +0
-2@@ -1032,7 +1032,6 @@ static int gbcodec_probe(struct snd_soc_component *comp)static void gbcodec_remove (struct snd_soc_component *comp) {/* Empty function for now */ -return ; } static int gbcodec_write(struct snd_soc_component *comp, unsigned int reg, --2.25.1
Re: [PATCH 2/2] staging: greybus: remove return in an empty void function
Quoted 16 lines · Julia Lawall
Quoted 2 lines · Jaehee Park
Issue found by checkpatch:
WARNING: void function return statements are not generally usefulEven for a simple change, it wouldbe better to follow the model that the subject line should concisely orient the reader (eg "remove unneeded return") and the log message should give a more complete description. Simply repeating what checkpatch tells you is rarely a good idea. It says what the problem is in a general way, whereas you should be explaining the reasoning behind your fix in a specific case. Here you could say that an empty function with void return type does not need an explicit return, and that the problem was detected with checkpatch.
Quoted 2 lines
julia
Thank you for your edits. I've submitted version 2 of the patchset just now.
Quoted 23 lines
Quoted 23 lines
Signed-off-by Jaehee Park <[email protected]>--- drivers/staging/greybus/audio_codec.c | 1 - 1 file changed, 1 deletion(-)drivers/staging/greybus/audio_codec.c +0
-2@@ -1032,7 +1032,6 @@ static int gbcodec_probe(struct snd_soc_component *comp)static void gbcodec_remove (struct snd_soc_component *comp) {/* Empty function for now */ -return ; } static int gbcodec_write(struct snd_soc_component *comp, unsigned int reg, --2.25.1
Re: [PATCH 2/2] staging: greybus: remove return in an empty void function
In reply to Jaehee ParkQuoted 13 lines · Jaehee Park
Issue found by checkpatch:
WARNING: void function return statements are not generally usefulSigned-off-by Jaehee Park <[email protected]>--- drivers/staging/greybus/audio_codec.c | 1 - 1 file changed, 1 deletion(-)drivers/staging/greybus/audio_codec.c +0
-0
drivers/staging/greybus/audio_codec.c static int gbcodec_probe(struct snd_soc_component *comp) · line 1035
Quoted 5 lines
drivers/staging/greybus/audio_codec.c +0
-1@@ -1032,7 +1032,6 @@ static int gbcodec_probe(struct snd_soc_component *comp)static void gbcodec_remove (struct snd_soc_component *comp) {/* Empty function for now */ -return ; }
This function is called from snd_soc_component_remove(). You can safely remove the whole function. We do not like empty stub functions.
regards,
dan carpenter
Re: [PATCH 2/2] staging: greybus: remove return in an empty void function
Quoted 9 lines · Dan Carpenter
Quoted 8 lines · Jaehee Park
Issue found by checkpatch:
WARNING: void function return statements are not generally usefulSigned-off-by Jaehee Park <[email protected]>--- drivers/staging/greybus/audio_codec.c | 1 - 1 file changed, 1 deletion(-)
Quoted 13 lines
drivers/staging/greybus/audio_codec.c static int gbcodec_probe(struct snd_soc_component *comp) · line 1035
Quoted 10 lines
drivers/staging/greybus/audio_codec.c +0
-1@@ -1032,7 +1032,6 @@ static int gbcodec_probe(struct snd_soc_component *comp)static void gbcodec_remove (struct snd_soc_component *comp) {/* Empty function for now */ -return ; }This function is called from
snd_soc_component_remove(). You can safely remove the whole function. We do not like empty stub functions.
I'll make this into another patch. Thank you for your suggestion.
Quoted 4 lines
regards,
dan carpenter
Quoted 11 lines · Jaehee Park
The first patch corrects a typo in a comment. The second patch fixes 'void function return statements are not generally useful' warning.
Jaehee Park (2):
staging: greybus: correct typo in comment 'Atleast' to 'At least'
staging: greybus: remove return in an empty void functiondrivers/staging/greybus/arche-apb-ctrl.c | 2 +- drivers/staging/greybus/audio_codec.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
These are really trivial patches. Whether the second one is even worth changing is questionable (it represents "code churn" without really adding value).
That said, you've properly submitted the patches and I have no problem with either one. So someone else can object, but if they do not: