linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] soundwire: bus: provide correct return value on error
@ 2020-02-25 16:49 Pierre-Louis Bossart
  2020-02-26  8:03 ` Vinod Koul
  0 siblings, 1 reply; 3+ messages in thread
From: Pierre-Louis Bossart @ 2020-02-25 16:49 UTC (permalink / raw)
  To: alsa-devel
  Cc: linux-kernel, tiwai, broonie, vkoul, gregkh, jank,
	srinivas.kandagatla, slawomir.blauciak, Bard liao, Rander Wang,
	Ranjani Sridharan, Hui Wang, Pierre-Louis Bossart, Sanyog Kale

From: Bard Liao <yung-chuan.liao@linux.intel.com>

It seems to be a typo. It makes more sense to return the return value
of sdw_update() instead of the value we want to update.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 drivers/soundwire/bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c
index 13887713f311..b8a7a84aca1c 100644
--- a/drivers/soundwire/bus.c
+++ b/drivers/soundwire/bus.c
@@ -1070,7 +1070,7 @@ static int sdw_initialize_slave(struct sdw_slave *slave)
 	if (ret < 0) {
 		dev_err(slave->bus->dev,
 			"SDW_DP0_INTMASK read failed:%d\n", ret);
-		return val;
+		return ret;
 	}
 
 	return 0;
-- 
2.20.1


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

* Re: [PATCH] soundwire: bus: provide correct return value on error
  2020-02-25 16:49 [PATCH] soundwire: bus: provide correct return value on error Pierre-Louis Bossart
@ 2020-02-26  8:03 ` Vinod Koul
  2020-02-26 14:54   ` Pierre-Louis Bossart
  0 siblings, 1 reply; 3+ messages in thread
From: Vinod Koul @ 2020-02-26  8:03 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: alsa-devel, linux-kernel, tiwai, broonie, gregkh, jank,
	srinivas.kandagatla, slawomir.blauciak, Bard liao, Rander Wang,
	Ranjani Sridharan, Hui Wang, Sanyog Kale

On 25-02-20, 10:49, Pierre-Louis Bossart wrote:
> From: Bard Liao <yung-chuan.liao@linux.intel.com>
> 
> It seems to be a typo. It makes more sense to return the return value
> of sdw_update() instead of the value we want to update.
> 
> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> ---
>  drivers/soundwire/bus.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c
> index 13887713f311..b8a7a84aca1c 100644
> --- a/drivers/soundwire/bus.c
> +++ b/drivers/soundwire/bus.c
> @@ -1070,7 +1070,7 @@ static int sdw_initialize_slave(struct sdw_slave *slave)
>  	if (ret < 0) {
>  		dev_err(slave->bus->dev,
>  			"SDW_DP0_INTMASK read failed:%d\n", ret);
> -		return val;
> +		return ret;

good catch. But can we optimize it to:
>  	}
>  
>  	return 0;

make this as below and remove the return above.

        return ret;
> -- 
> 2.20.1

-- 
~Vinod

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

* Re: [PATCH] soundwire: bus: provide correct return value on error
  2020-02-26  8:03 ` Vinod Koul
@ 2020-02-26 14:54   ` Pierre-Louis Bossart
  0 siblings, 0 replies; 3+ messages in thread
From: Pierre-Louis Bossart @ 2020-02-26 14:54 UTC (permalink / raw)
  To: Vinod Koul
  Cc: alsa-devel, tiwai, gregkh, linux-kernel, Ranjani Sridharan,
	Hui Wang, broonie, srinivas.kandagatla, jank, slawomir.blauciak,
	Sanyog Kale, Bard liao, Rander Wang



On 2/26/20 2:03 AM, Vinod Koul wrote:
> On 25-02-20, 10:49, Pierre-Louis Bossart wrote:
>> From: Bard Liao <yung-chuan.liao@linux.intel.com>
>>
>> It seems to be a typo. It makes more sense to return the return value
>> of sdw_update() instead of the value we want to update.
>>
>> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
>> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
>> ---
>>   drivers/soundwire/bus.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c
>> index 13887713f311..b8a7a84aca1c 100644
>> --- a/drivers/soundwire/bus.c
>> +++ b/drivers/soundwire/bus.c
>> @@ -1070,7 +1070,7 @@ static int sdw_initialize_slave(struct sdw_slave *slave)
>>   	if (ret < 0) {
>>   		dev_err(slave->bus->dev,
>>   			"SDW_DP0_INTMASK read failed:%d\n", ret);
>> -		return val;
>> +		return ret;
> 
> good catch. But can we optimize it to:
>>   	}
>>   
>>   	return 0;
> 
> make this as below and remove the return above.

ok, will resend as v2.

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

end of thread, other threads:[~2020-02-26 16:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-25 16:49 [PATCH] soundwire: bus: provide correct return value on error Pierre-Louis Bossart
2020-02-26  8:03 ` Vinod Koul
2020-02-26 14:54   ` Pierre-Louis Bossart

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