public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] drm/msm/dsi: Remove use of device_node in dsi_host_parse_dt()
@ 2022-08-29 16:54 Nathan Chancellor
  2022-08-30 16:58 ` Abhinav Kumar
  2022-08-30 20:42 ` Dmitry Baryshkov
  0 siblings, 2 replies; 3+ messages in thread
From: Nathan Chancellor @ 2022-08-29 16:54 UTC (permalink / raw)
  To: Rob Clark, Abhinav Kumar, Dmitry Baryshkov
  Cc: Sean Paul, Nick Desaulniers, Tom Rix, linux-arm-msm, dri-devel,
	freedreno, linux-kernel, llvm, patches, Nathan Chancellor

Clang warns:

  drivers/gpu/drm/msm/dsi/dsi_host.c:1903:14: error: variable 'device_node' is uninitialized when used here [-Werror,-Wuninitialized]
          of_node_put(device_node);
                      ^~~~~~~~~~~
  drivers/gpu/drm/msm/dsi/dsi_host.c:1870:44: note: initialize the variable 'device_node' to silence this warning
          struct device_node *endpoint, *device_node;
                                                    ^
                                                    = NULL
  1 error generated.

device_node's assignment was removed but not all of its uses. Remove the
call to of_node_put() and the variable declaration to clean up the
warning.

Fixes: 5f8cdece42ff ("drm/msm/dsi: switch to DRM_PANEL_BRIDGE")
Link: https://github.com/ClangBuiltLinux/linux/issues/1700
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index 57a4c0fa614b..7fbf391c024f 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -1867,7 +1867,7 @@ static int dsi_host_parse_dt(struct msm_dsi_host *msm_host)
 {
 	struct device *dev = &msm_host->pdev->dev;
 	struct device_node *np = dev->of_node;
-	struct device_node *endpoint, *device_node;
+	struct device_node *endpoint;
 	int ret = 0;
 
 	/*
@@ -1900,8 +1900,6 @@ static int dsi_host_parse_dt(struct msm_dsi_host *msm_host)
 		}
 	}
 
-	of_node_put(device_node);
-
 err:
 	of_node_put(endpoint);
 

base-commit: 5f8cdece42ff0c615e213b6619d29487f9f409d7
-- 
2.37.2


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

* Re: [PATCH] drm/msm/dsi: Remove use of device_node in dsi_host_parse_dt()
  2022-08-29 16:54 [PATCH] drm/msm/dsi: Remove use of device_node in dsi_host_parse_dt() Nathan Chancellor
@ 2022-08-30 16:58 ` Abhinav Kumar
  2022-08-30 20:42 ` Dmitry Baryshkov
  1 sibling, 0 replies; 3+ messages in thread
From: Abhinav Kumar @ 2022-08-30 16:58 UTC (permalink / raw)
  To: Nathan Chancellor, Rob Clark, Dmitry Baryshkov
  Cc: Sean Paul, Nick Desaulniers, Tom Rix, linux-arm-msm, dri-devel,
	freedreno, linux-kernel, llvm, patches



On 8/29/2022 9:54 AM, Nathan Chancellor wrote:
> Clang warns:
> 
>    drivers/gpu/drm/msm/dsi/dsi_host.c:1903:14: error: variable 'device_node' is uninitialized when used here [-Werror,-Wuninitialized]
>            of_node_put(device_node);
>                        ^~~~~~~~~~~
>    drivers/gpu/drm/msm/dsi/dsi_host.c:1870:44: note: initialize the variable 'device_node' to silence this warning
>            struct device_node *endpoint, *device_node;
>                                                      ^
>                                                      = NULL
>    1 error generated.
> 
> device_node's assignment was removed but not all of its uses. Remove the
> call to of_node_put() and the variable declaration to clean up the
> warning.
> 
> Fixes: 5f8cdece42ff ("drm/msm/dsi: switch to DRM_PANEL_BRIDGE")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1700
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
> ---
>   drivers/gpu/drm/msm/dsi/dsi_host.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
> index 57a4c0fa614b..7fbf391c024f 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi_host.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
> @@ -1867,7 +1867,7 @@ static int dsi_host_parse_dt(struct msm_dsi_host *msm_host)
>   {
>   	struct device *dev = &msm_host->pdev->dev;
>   	struct device_node *np = dev->of_node;
> -	struct device_node *endpoint, *device_node;
> +	struct device_node *endpoint;
>   	int ret = 0;
>   
>   	/*
> @@ -1900,8 +1900,6 @@ static int dsi_host_parse_dt(struct msm_dsi_host *msm_host)
>   		}
>   	}
>   
> -	of_node_put(device_node);
> -
>   err:
>   	of_node_put(endpoint);
>   
> 
> base-commit: 5f8cdece42ff0c615e213b6619d29487f9f409d7

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

* Re: [PATCH] drm/msm/dsi: Remove use of device_node in dsi_host_parse_dt()
  2022-08-29 16:54 [PATCH] drm/msm/dsi: Remove use of device_node in dsi_host_parse_dt() Nathan Chancellor
  2022-08-30 16:58 ` Abhinav Kumar
@ 2022-08-30 20:42 ` Dmitry Baryshkov
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Baryshkov @ 2022-08-30 20:42 UTC (permalink / raw)
  To: Nathan Chancellor, Rob Clark, Abhinav Kumar
  Cc: Sean Paul, Nick Desaulniers, Tom Rix, linux-arm-msm, dri-devel,
	freedreno, linux-kernel, llvm, patches

On 29/08/2022 19:54, Nathan Chancellor wrote:
> Clang warns:
> 
>    drivers/gpu/drm/msm/dsi/dsi_host.c:1903:14: error: variable 'device_node' is uninitialized when used here [-Werror,-Wuninitialized]
>            of_node_put(device_node);
>                        ^~~~~~~~~~~
>    drivers/gpu/drm/msm/dsi/dsi_host.c:1870:44: note: initialize the variable 'device_node' to silence this warning
>            struct device_node *endpoint, *device_node;
>                                                      ^
>                                                      = NULL
>    1 error generated.
> 
> device_node's assignment was removed but not all of its uses. Remove the
> call to of_node_put() and the variable declaration to clean up the
> warning.
> 
> Fixes: 5f8cdece42ff ("drm/msm/dsi: switch to DRM_PANEL_BRIDGE")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1700
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

-- 
With best wishes
Dmitry


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

end of thread, other threads:[~2022-08-30 20:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-29 16:54 [PATCH] drm/msm/dsi: Remove use of device_node in dsi_host_parse_dt() Nathan Chancellor
2022-08-30 16:58 ` Abhinav Kumar
2022-08-30 20:42 ` Dmitry Baryshkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox