RE: [PATCH] drm/amd/amdgpu: Simplify switch case statements in amdgpu_connectors.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[Public]

> -----Original Message-----
> From: SHANMUGAM, SRINIVASAN
> <SRINIVASAN.SHANMUGAM@xxxxxxx>
> Sent: Thursday, April 27, 2023 11:02 AM
> To: Koenig, Christian <Christian.Koenig@xxxxxxx>; Deucher, Alexander
> <Alexander.Deucher@xxxxxxx>
> Cc: amd-gfx@xxxxxxxxxxxxxxxxxxxxx; SHANMUGAM, SRINIVASAN
> <SRINIVASAN.SHANMUGAM@xxxxxxx>
> Subject: [PATCH] drm/amd/amdgpu: Simplify switch case statements in
> amdgpu_connectors.c
> 
> Fix the following checkpatch errors:
> 
> ERROR: trailing statements should be on next line
> ERROR: space required after that ',' (ctx:VxV)
> ERROR: code indent should use tabs where possible
> 
> Cc: Christian König <christian.koenig@xxxxxxx>
> Cc: Alex Deucher <alexander.deucher@xxxxxxx>
> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@xxxxxxx>

I could kind of go either way on these patches.  I guess they fix up the coding style, but they also make a lot of churn in the code.

Acked-by: Alex Deucher <alexander.deucher@xxxxxxx>

> ---
>  .../gpu/drm/amd/amdgpu/amdgpu_connectors.c    | 39 ++++++++++++++--
> ---
>  1 file changed, 29 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> index d2abd334b1b5..08a37b7a34f4 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> @@ -591,11 +591,20 @@ static int amdgpu_connector_set_property(struct
> drm_connector *connector,
> 
>  		switch (val) {
>  		default:
> -		case DRM_MODE_SCALE_NONE: rmx_type = RMX_OFF;
> break;
> -		case DRM_MODE_SCALE_CENTER: rmx_type =
> RMX_CENTER; break;
> -		case DRM_MODE_SCALE_ASPECT: rmx_type = RMX_ASPECT;
> break;
> -		case DRM_MODE_SCALE_FULLSCREEN: rmx_type =
> RMX_FULL; break;
> +		case DRM_MODE_SCALE_NONE:
> +			rmx_type = RMX_OFF;
> +			break;
> +		case DRM_MODE_SCALE_CENTER:
> +			rmx_type = RMX_CENTER;
> +			break;
> +		case DRM_MODE_SCALE_ASPECT:
> +			rmx_type = RMX_ASPECT;
> +			break;
> +		case DRM_MODE_SCALE_FULLSCREEN:
> +			rmx_type = RMX_FULL;
> +			break;
>  		}
> +
>  		if (amdgpu_encoder->rmx_type == rmx_type)
>  			return 0;
> 
> @@ -797,12 +806,21 @@ static int
> amdgpu_connector_set_lcd_property(struct drm_connector *connector,
>  	}
> 
>  	switch (value) {
> -	case DRM_MODE_SCALE_NONE: rmx_type = RMX_OFF; break;
> -	case DRM_MODE_SCALE_CENTER: rmx_type = RMX_CENTER; break;
> -	case DRM_MODE_SCALE_ASPECT: rmx_type = RMX_ASPECT; break;
> +	case DRM_MODE_SCALE_NONE:
> +		rmx_type = RMX_OFF;
> +		break;
> +	case DRM_MODE_SCALE_CENTER:
> +		rmx_type = RMX_CENTER;
> +		break;
> +	case DRM_MODE_SCALE_ASPECT:
> +		rmx_type = RMX_ASPECT;
> +		break;
>  	default:
> -	case DRM_MODE_SCALE_FULLSCREEN: rmx_type = RMX_FULL;
> break;
> +	case DRM_MODE_SCALE_FULLSCREEN:
> +		rmx_type = RMX_FULL;
> +		break;
>  	}
> +
>  	if (amdgpu_encoder->rmx_type == rmx_type)
>  		return 0;
> 
> @@ -1125,7 +1143,8 @@ amdgpu_connector_dvi_detect(struct
> drm_connector *connector, bool force)
>  					/* assume digital unless load
> detected otherwise */
>  					amdgpu_connector->use_digital =
> true;
>  					lret = encoder_funcs-
> >detect(encoder, connector);
> -					DRM_DEBUG_KMS("load_detect %x
> returned: %x\n",encoder->encoder_type,lret);
> +					DRM_DEBUG_KMS("load_detect %x
> returned: %x\n",
> +						      encoder->encoder_type,
> lret);
>  					if (lret ==
> connector_status_connected)
>  						amdgpu_connector-
> >use_digital = false;
>  				}
> @@ -1989,7 +2008,7 @@ amdgpu_connector_add(struct amdgpu_device
> *adev,
>  	if (amdgpu_connector->hpd.hpd == AMDGPU_HPD_NONE) {
>  		if (i2c_bus->valid) {
>  			connector->polled =
> DRM_CONNECTOR_POLL_CONNECT |
> -			                    DRM_CONNECTOR_POLL_DISCONNECT;
> +
> 	DRM_CONNECTOR_POLL_DISCONNECT;
>  		}
>  	} else
>  		connector->polled = DRM_CONNECTOR_POLL_HPD;
> --
> 2.25.1




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux