Skip to contentSkip to conversation

staging: greybus: fix warnings reported by checkpatch

PATCH In review Jaehee Park 4 participants 7 messages Apr 13, 2022 – Apr 20, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v3 cover staging: greybus: fix warnings reported by checkpatch

The first patch corrects a typo in a comment. The second patch removes an empty callback function.

Changes in version 3:
Edited the second patch in the patchset to remove the entire empty function with a void return type instead of removing just the return statement within the function.

Jaehee Park (2):
staging: greybus: correct typo in comment
staging: greybus: remove empty callback function

 drivers/staging/greybus/arche-apb-ctrl.c | 2 +-
 drivers/staging/greybus/audio_codec.c    | 8 --------
 2 files changed, 1 insertion(+), 9 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH v3 1/2 staging: greybus: correct typo in comment

Correct a spelling typo from 'Atleast' to 'At least' in comment. Issue found by checkpatch.

---
 drivers/staging/greybus/arche-apb-ctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/greybus/arche-apb-ctrl.c +1 -1
index bbf3ba744fc4..45afa208d004 100644
@@ -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
#2 lore raw

PATCH v3 2/2 staging: greybus: remove empty callback function

In reply to Jaehee Park

Remove the optional remove callback for the soc_codec_dev_gbaudio structure. The only place it is referenced is snd_soc_component_remove() which is only called if the sound_component pointer is non-null. The null function pointers here can be optionally ommitted. When a sound component is registered this way, the remove callback is optional. We can safely remove the whole gbcodec_remove function, which used to be an empty function with a void return type.

---
 drivers/staging/greybus/audio_codec.c | 8 --------
 1 file changed, 8 deletions(-)
drivers/staging/greybus/audio_codec.c +0 -8
index 0f50d1e51e2c..dc030caa64ba 100644
@@ -1029,12 +1029,6 @@ static int gbcodec_probe(struct snd_soc_component *comp)
 	return 0;
 }
 
-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,
 			 unsigned int value)
 {
@@ -1049,8 +1043,6 @@ static unsigned int gbcodec_read(struct snd_soc_component *comp,
 
 static const struct snd_soc_component_driver soc_codec_dev_gbaudio = {
 	.probe	= gbcodec_probe,
-	.remove	= gbcodec_remove,
-
 	.read = gbcodec_read,
 	.write = gbcodec_write,
 };
Signature · 1 line
2.25.1
#3 lore raw

Re: [PATCH v3 2/2] staging: greybus: remove empty callback function

Quoted 10 lines · Jaehee Park

Remove the optional remove callback for the soc_codec_dev_gbaudio structure. The only place it is referenced is snd_soc_component_remove() which is only called if the sound_component pointer is non-null. The null function pointers here can be optionally ommitted. When a sound component is registered this way, the remove callback is optional. We can safely remove the whole gbcodec_remove function, which used to be an empty function with a void return type.

Thanks!

regards,
dan carpenter

Reviewed-by on v3 2/2
#4 lore raw

Re: [PATCH v3 2/2] staging: greybus: remove empty callback function

In reply to Jaehee Park
Quoted 7 lines · Jaehee Park

Remove the optional remove callback for the soc_codec_dev_gbaudio structure. The only place it is referenced is snd_soc_component_remove() which is only called if the sound_component pointer is non-null. The null function pointers here can be optionally ommitted. When a sound component is registered this way, the remove callback is optional. We can safely remove the whole gbcodec_remove function, which used to be an empty function with a void return type.

Now I think your description is a little long... But that's OK.

This looks good to me. Thank you for responding to all our feedback.

Quoted 33 lines
---
  drivers/staging/greybus/audio_codec.c | 8 --------
  1 file changed, 8 deletions(-)
drivers/staging/greybus/audio_codec.c +0 -8
index 0f50d1e51e2c..dc030caa64ba 100644
@@ -1029,12 +1029,6 @@ static int gbcodec_probe(struct snd_soc_component *comp)
  	return 0;
  }
 
-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,
  			 unsigned int value)
  {
@@ -1049,8 +1043,6 @@ static unsigned int gbcodec_read(struct snd_soc_component *comp,
 
  static const struct snd_soc_component_driver soc_codec_dev_gbaudio = {
  	.probe	= gbcodec_probe,
-	.remove	= gbcodec_remove,
-
  	.read = gbcodec_read,
  	.write = gbcodec_write,
  };
#5 lore raw

Re: [PATCH v3 2/2] staging: greybus: remove empty callback function

Quoted 9 lines · Alex Elder
Quoted 7 lines · Jaehee Park

Remove the optional remove callback for the soc_codec_dev_gbaudio structure. The only place it is referenced is snd_soc_component_remove() which is only called if the sound_component pointer is non-null. The null function pointers here can be optionally ommitted. When a sound component is registered this way, the remove callback is optional. We can safely remove the whole gbcodec_remove function, which used to be an empty function with a void return type.

Quoted 6 lines

Now I think your description is a little long... But that's OK.

This looks good to me. Thank you for responding to all our feedback.

hi Greg, I saw that this was past on to staging-next already. Is it too late to add Alex to the reviewed by?

Quoted 32 lines
Quoted 31 lines
---
  drivers/staging/greybus/audio_codec.c | 8 --------
  1 file changed, 8 deletions(-)
drivers/staging/greybus/audio_codec.c +0 -8
index 0f50d1e51e2c..dc030caa64ba 100644
@@ -1029,12 +1029,6 @@ static int gbcodec_probe(struct snd_soc_component *comp)
  	return 0;
  }
-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,
  			 unsigned int value)
  {
@@ -1049,8 +1043,6 @@ static unsigned int gbcodec_read(struct snd_soc_component *comp,
  static const struct snd_soc_component_driver soc_codec_dev_gbaudio = {
  	.probe	= gbcodec_probe,
-	.remove	= gbcodec_remove,
-
  	.read = gbcodec_read,
  	.write = gbcodec_write,
  };
maintainer
#6 lore raw

Re: [PATCH v3 2/2] staging: greybus: remove empty callback function

Quoted 12 lines · Jaehee Park
Quoted 11 lines · Alex Elder
Quoted 7 lines · Jaehee Park

Remove the optional remove callback for the soc_codec_dev_gbaudio structure. The only place it is referenced is snd_soc_component_remove() which is only called if the sound_component pointer is non-null. The null function pointers here can be optionally ommitted. When a sound component is registered this way, the remove callback is optional. We can safely remove the whole gbcodec_remove function, which used to be an empty function with a void return type.

Now I think your description is a little long... But that's OK.

Quoted 7 lines
Quoted 4 lines

This looks good to me. Thank you for responding to all our feedback.

hi Greg, I saw that this was past on to staging-next already. Is it too late to add Alex to the reviewed by?

Yes, sorry.