drm/bridge: samsung-dsim: check the return value only if necessary

Message ID 20231207161056.183442-1-dario.binacchi@amarulasolutions.com
State New
Headers
Series drm/bridge: samsung-dsim: check the return value only if necessary |

Commit Message

Dario Binacchi Dec. 7, 2023, 4:10 p.m. UTC
  It was useless to check again the "ret" variable if the function
register_host() was not called.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---

 drivers/gpu/drm/bridge/samsung-dsim.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Comments

Frieder Schrempf Dec. 7, 2023, 4:42 p.m. UTC | #1
On 07.12.23 17:10, Dario Binacchi wrote:
> It was useless to check again the "ret" variable if the function
> register_host() was not called.
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>

> ---
> 
>  drivers/gpu/drm/bridge/samsung-dsim.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c
> index be5914caa17d..98cd589e4427 100644
> --- a/drivers/gpu/drm/bridge/samsung-dsim.c
> +++ b/drivers/gpu/drm/bridge/samsung-dsim.c
> @@ -2020,11 +2020,11 @@ int samsung_dsim_probe(struct platform_device *pdev)
>  	else
>  		dsi->bridge.timings = &samsung_dsim_bridge_timings_de_high;
>  
> -	if (dsi->plat_data->host_ops && dsi->plat_data->host_ops->register_host)
> +	if (dsi->plat_data->host_ops && dsi->plat_data->host_ops->register_host) {
>  		ret = dsi->plat_data->host_ops->register_host(dsi);
> -
> -	if (ret)
> -		goto err_disable_runtime;
> +		if (ret)
> +			goto err_disable_runtime;
> +	}
>  
>  	return 0;
>
  
Robert Foss Dec. 15, 2023, 2:12 p.m. UTC | #2
On Thu, 7 Dec 2023 17:10:43 +0100, Dario Binacchi wrote:
> It was useless to check again the "ret" variable if the function
> register_host() was not called.
> 
> 

Applied, thanks!

[1/1] drm/bridge: samsung-dsim: check the return value only if necessary
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=045159f5018e



Rob
  

Patch

diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c
index be5914caa17d..98cd589e4427 100644
--- a/drivers/gpu/drm/bridge/samsung-dsim.c
+++ b/drivers/gpu/drm/bridge/samsung-dsim.c
@@ -2020,11 +2020,11 @@  int samsung_dsim_probe(struct platform_device *pdev)
 	else
 		dsi->bridge.timings = &samsung_dsim_bridge_timings_de_high;
 
-	if (dsi->plat_data->host_ops && dsi->plat_data->host_ops->register_host)
+	if (dsi->plat_data->host_ops && dsi->plat_data->host_ops->register_host) {
 		ret = dsi->plat_data->host_ops->register_host(dsi);
-
-	if (ret)
-		goto err_disable_runtime;
+		if (ret)
+			goto err_disable_runtime;
+	}
 
 	return 0;