linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] staging: greybus: fix warnings reported by checkpatch
@ 2022-04-12  1:50 Jaehee Park
  2022-04-12  1:50 ` [PATCH 1/2] staging: greybus: correct typo in comment 'Atleast' to 'At least' Jaehee Park
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jaehee Park @ 2022-04-12  1:50 UTC (permalink / raw)
  To: johan
  Cc: elder, gregkh, greybus-dev, linux-staging, linux-kernel,
	outreachy, jhpark1013

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(-)

-- 
2.25.1


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

* [PATCH 1/2] staging: greybus: correct typo in comment 'Atleast' to 'At least'
  2022-04-12  1:50 [PATCH 0/2] staging: greybus: fix warnings reported by checkpatch Jaehee Park
@ 2022-04-12  1:50 ` Jaehee Park
  2022-04-12  1:50 ` [PATCH 2/2] staging: greybus: remove return in an empty void function Jaehee Park
  2022-04-12  1:55 ` [PATCH 0/2] staging: greybus: fix warnings reported by checkpatch Alex Elder
  2 siblings, 0 replies; 8+ messages in thread
From: Jaehee Park @ 2022-04-12  1:50 UTC (permalink / raw)
  To: johan
  Cc: elder, gregkh, greybus-dev, linux-staging, linux-kernel,
	outreachy, jhpark1013

Correct spelling typo.

Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
---
 drivers/staging/greybus/arche-apb-ctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/arche-apb-ctrl.c b/drivers/staging/greybus/arche-apb-ctrl.c
index bbf3ba744fc4..45afa208d004 100644
--- a/drivers/staging/greybus/arche-apb-ctrl.c
+++ b/drivers/staging/greybus/arche-apb-ctrl.c
@@ -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.
 	 *
-- 
2.25.1


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

* [PATCH 2/2] staging: greybus: remove return in an empty void function
  2022-04-12  1:50 [PATCH 0/2] staging: greybus: fix warnings reported by checkpatch Jaehee Park
  2022-04-12  1:50 ` [PATCH 1/2] staging: greybus: correct typo in comment 'Atleast' to 'At least' Jaehee Park
@ 2022-04-12  1:50 ` Jaehee Park
  2022-04-12  7:04   ` Julia Lawall
  2022-04-12  7:28   ` Dan Carpenter
  2022-04-12  1:55 ` [PATCH 0/2] staging: greybus: fix warnings reported by checkpatch Alex Elder
  2 siblings, 2 replies; 8+ messages in thread
From: Jaehee Park @ 2022-04-12  1:50 UTC (permalink / raw)
  To: johan
  Cc: elder, gregkh, greybus-dev, linux-staging, linux-kernel,
	outreachy, jhpark1013

Issue found by checkpatch:
WARNING: void function return statements are not generally useful

Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
---
 drivers/staging/greybus/audio_codec.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c
index 0f50d1e51e2c..3e3a16568def 100644
--- a/drivers/staging/greybus/audio_codec.c
+++ b/drivers/staging/greybus/audio_codec.c
@@ -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


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

* Re: [PATCH 0/2] staging: greybus: fix warnings reported by checkpatch
  2022-04-12  1:50 [PATCH 0/2] staging: greybus: fix warnings reported by checkpatch Jaehee Park
  2022-04-12  1:50 ` [PATCH 1/2] staging: greybus: correct typo in comment 'Atleast' to 'At least' Jaehee Park
  2022-04-12  1:50 ` [PATCH 2/2] staging: greybus: remove return in an empty void function Jaehee Park
@ 2022-04-12  1:55 ` Alex Elder
  2 siblings, 0 replies; 8+ messages in thread
From: Alex Elder @ 2022-04-12  1:55 UTC (permalink / raw)
  To: Jaehee Park, johan
  Cc: elder, gregkh, greybus-dev, linux-staging, linux-kernel, outreachy

On 4/11/22 8:50 PM, Jaehee Park wrote:
> 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(-)
> 

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:

Reviewed-by: Alex Elder <elder@linaro.org>

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

* Re: [PATCH 2/2] staging: greybus: remove return in an empty void function
  2022-04-12  1:50 ` [PATCH 2/2] staging: greybus: remove return in an empty void function Jaehee Park
@ 2022-04-12  7:04   ` Julia Lawall
  2022-04-12 20:02     ` Jaehee Park
  2022-04-12  7:28   ` Dan Carpenter
  1 sibling, 1 reply; 8+ messages in thread
From: Julia Lawall @ 2022-04-12  7:04 UTC (permalink / raw)
  To: Jaehee Park
  Cc: johan, elder, gregkh, greybus-dev, linux-staging, linux-kernel,
	outreachy



On Mon, 11 Apr 2022, Jaehee Park wrote:

> 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

>
> Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
> ---
>  drivers/staging/greybus/audio_codec.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c
> index 0f50d1e51e2c..3e3a16568def 100644
> --- a/drivers/staging/greybus/audio_codec.c
> +++ b/drivers/staging/greybus/audio_codec.c
> @@ -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
>
>
>

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

* Re: [PATCH 2/2] staging: greybus: remove return in an empty void function
  2022-04-12  1:50 ` [PATCH 2/2] staging: greybus: remove return in an empty void function Jaehee Park
  2022-04-12  7:04   ` Julia Lawall
@ 2022-04-12  7:28   ` Dan Carpenter
  2022-04-12 20:03     ` Jaehee Park
  1 sibling, 1 reply; 8+ messages in thread
From: Dan Carpenter @ 2022-04-12  7:28 UTC (permalink / raw)
  To: Jaehee Park
  Cc: johan, elder, gregkh, greybus-dev, linux-staging, linux-kernel,
	outreachy

On Mon, Apr 11, 2022 at 09:50:22PM -0400, Jaehee Park wrote:
> Issue found by checkpatch:
> WARNING: void function return statements are not generally useful
> 
> Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
> ---
>  drivers/staging/greybus/audio_codec.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c
> index 0f50d1e51e2c..3e3a16568def 100644
> --- a/drivers/staging/greybus/audio_codec.c
> +++ b/drivers/staging/greybus/audio_codec.c
> @@ -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


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

* Re: [PATCH 2/2] staging: greybus: remove return in an empty void function
  2022-04-12  7:04   ` Julia Lawall
@ 2022-04-12 20:02     ` Jaehee Park
  0 siblings, 0 replies; 8+ messages in thread
From: Jaehee Park @ 2022-04-12 20:02 UTC (permalink / raw)
  To: Julia Lawall
  Cc: johan, elder, gregkh, greybus-dev, linux-staging, linux-kernel,
	outreachy

On Tue, Apr 12, 2022 at 09:04:08AM +0200, Julia Lawall wrote:
> 
> 
> On Mon, 11 Apr 2022, Jaehee Park wrote:
> 
> > 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
> 

Thank you for your edits. I've submitted version 2 of the patchset just
now.

> >
> > Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
> > ---
> >  drivers/staging/greybus/audio_codec.c | 1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c
> > index 0f50d1e51e2c..3e3a16568def 100644
> > --- a/drivers/staging/greybus/audio_codec.c
> > +++ b/drivers/staging/greybus/audio_codec.c
> > @@ -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
> >
> >
> >

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

* Re: [PATCH 2/2] staging: greybus: remove return in an empty void function
  2022-04-12  7:28   ` Dan Carpenter
@ 2022-04-12 20:03     ` Jaehee Park
  0 siblings, 0 replies; 8+ messages in thread
From: Jaehee Park @ 2022-04-12 20:03 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: johan, elder, gregkh, greybus-dev, linux-staging, linux-kernel,
	outreachy

On Tue, Apr 12, 2022 at 10:28:43AM +0300, Dan Carpenter wrote:
> On Mon, Apr 11, 2022 at 09:50:22PM -0400, Jaehee Park wrote:
> > Issue found by checkpatch:
> > WARNING: void function return statements are not generally useful
> > 
> > Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
> > ---
> >  drivers/staging/greybus/audio_codec.c | 1 -
> >  1 file changed, 1 deletion(-)
> > 
> > diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c
> > index 0f50d1e51e2c..3e3a16568def 100644
> > --- a/drivers/staging/greybus/audio_codec.c
> > +++ b/drivers/staging/greybus/audio_codec.c
> > @@ -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.

> 
> regards,
> dan carpenter
> 

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

end of thread, other threads:[~2022-04-12 20:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-12  1:50 [PATCH 0/2] staging: greybus: fix warnings reported by checkpatch Jaehee Park
2022-04-12  1:50 ` [PATCH 1/2] staging: greybus: correct typo in comment 'Atleast' to 'At least' Jaehee Park
2022-04-12  1:50 ` [PATCH 2/2] staging: greybus: remove return in an empty void function Jaehee Park
2022-04-12  7:04   ` Julia Lawall
2022-04-12 20:02     ` Jaehee Park
2022-04-12  7:28   ` Dan Carpenter
2022-04-12 20:03     ` Jaehee Park
2022-04-12  1:55 ` [PATCH 0/2] staging: greybus: fix warnings reported by checkpatch Alex Elder

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).