[PATCH] drm/komeda: Fix warning -Wunused-but-set-variable

Ayan Halder Ayan.Halder at arm.com
Thu Aug 22 10:30:18 UTC 2019


On Mon, Aug 12, 2019 at 11:23:41AM +0000, james qian wang (Arm Technology China) wrote:
> Fixed two -Wunused-but-set-variable warnings:
> 
> /arm/linux/display/aosp-4.14-drm-next/drivers/gpu/drm/arm/display/komeda/komeda_kms.c: In function ‘komeda_crtc_normalize_zpos’:
> /arm/linux/display/aosp-4.14-drm-next/drivers/gpu/drm/arm/display/komeda/komeda_kms.c:150:26: warning: variable ‘fb’ set but not used [-Wunused-but-set-variable]
>   struct drm_framebuffer *fb;
>                           ^~
> /arm/linux/display/aosp-4.14-drm-next/drivers/gpu/drm/arm/display/komeda/komeda_kms.c: In function ‘komeda_kms_check’:
> /arm/linux/display/aosp-4.14-drm-next/drivers/gpu/drm/arm/display/komeda/komeda_kms.c:209:25: warning: variable ‘old_crtc_st’ set but not used [-Wunused-but-set-variable]
>   struct drm_crtc_state *old_crtc_st, *new_crtc_st;
>                          ^~~~~~~~~~~
> 
> Signed-off-by: james qian wang (Arm Technology China) <james.qian.wang at arm.com>
> ---
>  drivers/gpu/drm/arm/display/komeda/komeda_kms.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
> index d50e75f0b2bd..1f0e3f4e8d74 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
> @@ -147,7 +147,6 @@ static int komeda_crtc_normalize_zpos(struct drm_crtc *crtc,
>  	struct komeda_crtc_state *kcrtc_st = to_kcrtc_st(crtc_st);
>  	struct komeda_plane_state *kplane_st;
>  	struct drm_plane_state *plane_st;
> -	struct drm_framebuffer *fb;
>  	struct drm_plane *plane;
>  	struct list_head zorder_list;
>  	int order = 0, err;
> @@ -173,7 +172,6 @@ static int komeda_crtc_normalize_zpos(struct drm_crtc *crtc,
>  
>  	list_for_each_entry(kplane_st, &zorder_list, zlist_node) {
>  		plane_st = &kplane_st->base;
> -		fb = plane_st->fb;
>  		plane = plane_st->plane;
>  
>  		plane_st->normalized_zpos = order++;
> @@ -206,7 +204,7 @@ static int komeda_kms_check(struct drm_device *dev,
>  			    struct drm_atomic_state *state)
>  {
>  	struct drm_crtc *crtc;
> -	struct drm_crtc_state *old_crtc_st, *new_crtc_st;
> +	struct drm_crtc_state *new_crtc_st;
>  	int i, err;
>  
>  	err = drm_atomic_helper_check_modeset(dev, state);
> @@ -217,7 +215,7 @@ static int komeda_kms_check(struct drm_device *dev,
>  	 * so need to add all affected_planes (even unchanged) to
>  	 * drm_atomic_state.
>  	 */
> -	for_each_oldnew_crtc_in_state(state, crtc, old_crtc_st, new_crtc_st, i) {
> +	for_each_new_crtc_in_state(state, crtc, new_crtc_st, i) {
>  		err = drm_atomic_add_affected_planes(state, crtc);
>  		if (err)
>  			return err;
> -- 
Looks good to me.
Reviewed-by: Ayan Kumar Halder <ayan.halder at arm.com>

> 2.20.1
> 


More information about the dri-devel mailing list