linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Staging: greybus: audio_codec: changed a void function to return 0
@ 2021-10-28 15:38 Senthu Sivarajah
  2021-10-28 16:35 ` Bryan Brattlof
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Senthu Sivarajah @ 2021-10-28 15:38 UTC (permalink / raw)
  To: vaibhav.sr; +Cc: greybus-dev, linux-staging, linux-kernel, Senthuran Sivarajah

From: Senthuran Sivarajah <ssivaraj@stud.fra-uas.de>

Fixed a coding style issue.

Signed-off-by: Senthuran Sivarajah <ssivaraj@stud.fra-uas.de>

---
 drivers/staging/greybus/audio_codec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c
index b589cf6b1d03..9f99862791dc 100644
--- a/drivers/staging/greybus/audio_codec.c
+++ b/drivers/staging/greybus/audio_codec.c
@@ -1028,7 +1028,7 @@ static int gbcodec_probe(struct snd_soc_component *comp)
 static void gbcodec_remove(struct snd_soc_component *comp)
 {
 	/* Empty function for now */
-	return;
+	return 0;
 }
 
 static int gbcodec_write(struct snd_soc_component *comp, unsigned int reg,
-- 
2.27.0


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

* Re: [PATCH] Staging: greybus: audio_codec: changed a void function to return 0
  2021-10-28 15:38 [PATCH] Staging: greybus: audio_codec: changed a void function to return 0 Senthu Sivarajah
@ 2021-10-28 16:35 ` Bryan Brattlof
  2021-10-28 16:42 ` Greg KH
  2021-10-29  2:09 ` kernel test robot
  2 siblings, 0 replies; 5+ messages in thread
From: Bryan Brattlof @ 2021-10-28 16:35 UTC (permalink / raw)
  To: Senthu Sivarajah; +Cc: vaibhav.sr, greybus-dev, linux-staging, linux-kernel

Hi Senthu,

On this day, October 28, 2021, thus sayeth Senthu Sivarajah:
> From: Senthuran Sivarajah <ssivaraj@stud.fra-uas.de>
> 
> Fixed a coding style issue.
> 
> Signed-off-by: Senthuran Sivarajah <ssivaraj@stud.fra-uas.de>
> 
> ---
>  drivers/staging/greybus/audio_codec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c
> index b589cf6b1d03..9f99862791dc 100644
> --- a/drivers/staging/greybus/audio_codec.c
> +++ b/drivers/staging/greybus/audio_codec.c
> @@ -1028,7 +1028,7 @@ static int gbcodec_probe(struct snd_soc_component *comp)
>  static void gbcodec_remove(struct snd_soc_component *comp)
	  ^^^^

If I'm not mistaken here, our options are to remove the return or just 
leave this as is. IMO I think this is fine as is.

~Bryan

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

* Re: [PATCH] Staging: greybus: audio_codec: changed a void function to return 0
  2021-10-28 15:38 [PATCH] Staging: greybus: audio_codec: changed a void function to return 0 Senthu Sivarajah
  2021-10-28 16:35 ` Bryan Brattlof
@ 2021-10-28 16:42 ` Greg KH
  2021-10-28 17:19   ` Senthuran Sivarajah
  2021-10-29  2:09 ` kernel test robot
  2 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2021-10-28 16:42 UTC (permalink / raw)
  To: Senthu Sivarajah; +Cc: vaibhav.sr, greybus-dev, linux-staging, linux-kernel

On Thu, Oct 28, 2021 at 05:38:08PM +0200, Senthu Sivarajah wrote:
> From: Senthuran Sivarajah <ssivaraj@stud.fra-uas.de>
> 
> Fixed a coding style issue.

What coding style exactly?

> 
> Signed-off-by: Senthuran Sivarajah <ssivaraj@stud.fra-uas.de>
> 
> ---
>  drivers/staging/greybus/audio_codec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c
> index b589cf6b1d03..9f99862791dc 100644
> --- a/drivers/staging/greybus/audio_codec.c
> +++ b/drivers/staging/greybus/audio_codec.c
> @@ -1028,7 +1028,7 @@ static int gbcodec_probe(struct snd_soc_component *comp)
>  static void gbcodec_remove(struct snd_soc_component *comp)
>  {
>  	/* Empty function for now */
> -	return;
> +	return 0;

Did you build this change?

Exactly what tool reported a problem with this code and what was the
exact error?

thanks,

greg k-h

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

* Re: [PATCH] Staging: greybus: audio_codec: changed a void function to return 0
  2021-10-28 16:42 ` Greg KH
@ 2021-10-28 17:19   ` Senthuran Sivarajah
  0 siblings, 0 replies; 5+ messages in thread
From: Senthuran Sivarajah @ 2021-10-28 17:19 UTC (permalink / raw)
  To: Greg KH; +Cc: vaibhav.sr, greybus-dev, linux-staging, linux-kernel

Hello Greg,

I've run the checkpatch.pl script on audio_code.c:
> ./scripts/checkpatch.pl --file --terse 
> drivers/staging/greybus/audio_codec.c

and got the following warning:
> drivers/staging/greybus/audio_codec.c:1032: WARNING: void function 
> return statements are not generally useful

As Brian wrote, we can either remove the return or leave it as is, so my 
"changes" can be ignored. This is not a coding style issue and I should 
have been more clear on the commit message. I apologize for the mistake.

Thank you and @Brian for taking the time to reply.

Kind regards,
Senthu

Am 28.10.2021 18:42, schrieb Greg KH:
> On Thu, Oct 28, 2021 at 05:38:08PM +0200, Senthu Sivarajah wrote:
>> From: Senthuran Sivarajah <ssivaraj@stud.fra-uas.de>
>> 
>> Fixed a coding style issue.
> 
> What coding style exactly?
> 
>> 
>> Signed-off-by: Senthuran Sivarajah <ssivaraj@stud.fra-uas.de>
>> 
>> ---
>>  drivers/staging/greybus/audio_codec.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/staging/greybus/audio_codec.c 
>> b/drivers/staging/greybus/audio_codec.c
>> index b589cf6b1d03..9f99862791dc 100644
>> --- a/drivers/staging/greybus/audio_codec.c
>> +++ b/drivers/staging/greybus/audio_codec.c
>> @@ -1028,7 +1028,7 @@ static int gbcodec_probe(struct 
>> snd_soc_component *comp)
>>  static void gbcodec_remove(struct snd_soc_component *comp)
>>  {
>>  	/* Empty function for now */
>> -	return;
>> +	return 0;
> 
> Did you build this change?
> 
> Exactly what tool reported a problem with this code and what was the
> exact error?
> 
> thanks,
> 
> greg k-h

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

* Re: [PATCH] Staging: greybus: audio_codec: changed a void function to return 0
  2021-10-28 15:38 [PATCH] Staging: greybus: audio_codec: changed a void function to return 0 Senthu Sivarajah
  2021-10-28 16:35 ` Bryan Brattlof
  2021-10-28 16:42 ` Greg KH
@ 2021-10-29  2:09 ` kernel test robot
  2 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2021-10-29  2:09 UTC (permalink / raw)
  To: Senthu Sivarajah, vaibhav.sr
  Cc: llvm, kbuild-all, greybus-dev, linux-staging, linux-kernel,
	Senthuran Sivarajah

[-- Attachment #1: Type: text/plain, Size: 1899 bytes --]

Hi Senthu,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/0day-ci/linux/commits/Senthu-Sivarajah/Staging-greybus-audio_codec-changed-a-void-function-to-return-0/20211029-000251
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 3d34b180323b487cad6f1e7560f1ec653110c899
config: i386-randconfig-a012-20211028 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5db7568a6a1fcb408eb8988abdaff2a225a8eb72)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/0b582ab4c534ce5976b1d04848abb837a82d87c9
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Senthu-Sivarajah/Staging-greybus-audio_codec-changed-a-void-function-to-return-0/20211029-000251
        git checkout 0b582ab4c534ce5976b1d04848abb837a82d87c9
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/staging/greybus/audio_codec.c:1031:2: error: void function 'gbcodec_remove' should not return a value [-Wreturn-type]
           return 0;
           ^      ~
   1 error generated.


vim +/gbcodec_remove +1031 drivers/staging/greybus/audio_codec.c

  1027	
  1028	static void gbcodec_remove(struct snd_soc_component *comp)
  1029	{
  1030		/* Empty function for now */
> 1031		return 0;
  1032	}
  1033	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 36600 bytes --]

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

end of thread, other threads:[~2021-10-29  2:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-28 15:38 [PATCH] Staging: greybus: audio_codec: changed a void function to return 0 Senthu Sivarajah
2021-10-28 16:35 ` Bryan Brattlof
2021-10-28 16:42 ` Greg KH
2021-10-28 17:19   ` Senthuran Sivarajah
2021-10-29  2:09 ` kernel test robot

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