[Intel-gfx] [PATCH 6/9] drm/nouveau: Fix unused variable warning

Laurent Pinchart laurent.pinchart at ideasonboard.com
Mon Mar 2 13:30:23 UTC 2020


Hi Pankaj,

Thank you for the patch.

On Mon, Mar 02, 2020 at 06:26:46PM +0530, Pankaj Bharadiya wrote:
> nouveau_drm pointer is not getting used anymore in
> nv50_mstm_{register,destroy}_connector functions, hence remove it.
> 
> This fixes below warning.
> 
> drivers/gpu/drm/nouveau/dispnv50/disp.c: In function ‘nv50_mstm_destroy_connector’:
> drivers/gpu/drm/nouveau/dispnv50/disp.c:1263:22: warning: unused variable ‘drm’ [-Wunused-variable]
>   struct nouveau_drm *drm = nouveau_drm(connector->dev);
>                       ^~~
> drivers/gpu/drm/nouveau/dispnv50/disp.c: In function ‘nv50_mstm_register_connector’:
> drivers/gpu/drm/nouveau/dispnv50/disp.c:1274:22: warning: unused variable ‘drm’ [-Wunused-variable]
>   struct nouveau_drm *drm = nouveau_drm(connector->dev);
>                       ^~~

As commented on 7/9, you should squash this with the patch that
introduces the warnings.

> Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya at intel.com>
> ---
>  drivers/gpu/drm/nouveau/dispnv50/disp.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> index 97dd50e2917d..4e164ad8003f 100644
> --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
> +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> @@ -1260,7 +1260,6 @@ static void
>  nv50_mstm_destroy_connector(struct drm_dp_mst_topology_mgr *mgr,
>  			    struct drm_connector *connector)
>  {
> -	struct nouveau_drm *drm = nouveau_drm(connector->dev);
>  	struct nv50_mstc *mstc = nv50_mstc(connector);
>  
>  	drm_connector_unregister(&mstc->connector);
> @@ -1271,8 +1270,6 @@ nv50_mstm_destroy_connector(struct drm_dp_mst_topology_mgr *mgr,
>  static void
>  nv50_mstm_register_connector(struct drm_connector *connector)
>  {
> -	struct nouveau_drm *drm = nouveau_drm(connector->dev);
> -
>  	drm_connector_register(connector);
>  }
>  

-- 
Regards,

Laurent Pinchart


More information about the Intel-gfx mailing list