diff mbox series

[v1,2/4] platform/x86: int3472: Simplify dev_err_probe() usage

Message ID 20240821122233.3761645-3-andriy.shevchenko@linux.intel.com (mailing list archive)
State Changes Requested, archived
Headers show
Series platform/x86: int3472: A few cleanups | expand

Commit Message

Andy Shevchenko Aug. 21, 2024, 12:20 p.m. UTC
Since dev_err_probe() ignores success, i.e. 0. we may call
it unconditionally.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/platform/x86/intel/int3472/discrete.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Christophe JAILLET Aug. 21, 2024, 12:35 p.m. UTC | #1
Le 21/08/2024 à 14:20, Andy Shevchenko a écrit :
> Since dev_err_probe() ignores success,

Hi,

Does it really?
It does not seem to be the case (at least on linux-next). Or I miss 
something obvious?

CJ

> i.e. 0. we may call
> it unconditionally.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>   drivers/platform/x86/intel/int3472/discrete.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platform/x86/intel/int3472/discrete.c
> index 07b302e09340..cd0743300d7f 100644
> --- a/drivers/platform/x86/intel/int3472/discrete.c
> +++ b/drivers/platform/x86/intel/int3472/discrete.c
> @@ -289,10 +289,7 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,
>   	int3472->ngpios++;
>   	ACPI_FREE(obj);
>   
> -	if (ret < 0)
> -		return dev_err_probe(int3472->dev, ret, err_msg);
> -
> -	return ret;
> +	return dev_err_probe(int3472->dev, ret, err_msg);
>   }
>   
>   static int skl_int3472_parse_crs(struct int3472_discrete_device *int3472)
Ilpo Järvinen Aug. 21, 2024, 12:39 p.m. UTC | #2
On Wed, 21 Aug 2024, Christophe JAILLET wrote:

> Le 21/08/2024 à 14:20, Andy Shevchenko a écrit :
> > Since dev_err_probe() ignores success,
> 
> Hi,
> 
> Does it really?
> It does not seem to be the case (at least on linux-next). Or I miss something
> obvious?

Yes, you're missing the first patch of the series. :-)
Ilpo Järvinen Aug. 21, 2024, 12:39 p.m. UTC | #3
On Wed, 21 Aug 2024, Andy Shevchenko wrote:

> Since dev_err_probe() ignores success, i.e. 0. we may call
> it unconditionally.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/platform/x86/intel/int3472/discrete.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platform/x86/intel/int3472/discrete.c
> index 07b302e09340..cd0743300d7f 100644
> --- a/drivers/platform/x86/intel/int3472/discrete.c
> +++ b/drivers/platform/x86/intel/int3472/discrete.c
> @@ -289,10 +289,7 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,
>  	int3472->ngpios++;
>  	ACPI_FREE(obj);
>  
> -	if (ret < 0)
> -		return dev_err_probe(int3472->dev, ret, err_msg);
> -
> -	return ret;
> +	return dev_err_probe(int3472->dev, ret, err_msg);
>  }
>  
>  static int skl_int3472_parse_crs(struct int3472_discrete_device *int3472)
> 

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Christophe JAILLET Aug. 21, 2024, 12:41 p.m. UTC | #4
Le 21/08/2024 à 14:39, Ilpo Järvinen a écrit :
> On Wed, 21 Aug 2024, Christophe JAILLET wrote:
> 
>> Le 21/08/2024 à 14:20, Andy Shevchenko a écrit :
>>> Since dev_err_probe() ignores success,
>>
>> Hi,
>>
>> Does it really?
>> It does not seem to be the case (at least on linux-next). Or I miss something
>> obvious?
> 
> Yes, you're missing the first patch of the series. :-)
> 

Lol.

Sorry for the noise. (* blushing *)

CJ
diff mbox series

Patch

diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platform/x86/intel/int3472/discrete.c
index 07b302e09340..cd0743300d7f 100644
--- a/drivers/platform/x86/intel/int3472/discrete.c
+++ b/drivers/platform/x86/intel/int3472/discrete.c
@@ -289,10 +289,7 @@  static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,
 	int3472->ngpios++;
 	ACPI_FREE(obj);
 
-	if (ret < 0)
-		return dev_err_probe(int3472->dev, ret, err_msg);
-
-	return ret;
+	return dev_err_probe(int3472->dev, ret, err_msg);
 }
 
 static int skl_int3472_parse_crs(struct int3472_discrete_device *int3472)