Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amd/display: Remove else after return in 'dm_crtc_get_scanoutpos()'

Conform to Linux kernel coding style.

Reported by checkpatch:

WARNING: else is not generally useful after a break or return

Expressions under 'else' branch in function 'dm_crtc_get_scanoutpos' are
executed whenever the expression in 'if' is False. Otherwise, return
from function occurs. Therefore, there is no need in 'else', and it has
been removed.

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Srinivasan Shanmugam and committed by
Alex Deucher
0c2d77be 44a4f50d

+19 -19
+19 -19
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 264 264 u32 *vbl, u32 *position) 265 265 { 266 266 u32 v_blank_start, v_blank_end, h_position, v_position; 267 + struct amdgpu_crtc *acrtc = NULL; 267 268 268 269 if ((crtc < 0) || (crtc >= adev->mode_info.num_crtc)) 269 270 return -EINVAL; 270 - else { 271 - struct amdgpu_crtc *acrtc = adev->mode_info.crtcs[crtc]; 272 271 273 - if (acrtc->dm_irq_params.stream == NULL) { 274 - DRM_ERROR("dc_stream_state is NULL for crtc '%d'!\n", 275 - crtc); 276 - return 0; 277 - } 272 + acrtc = adev->mode_info.crtcs[crtc]; 278 273 279 - /* 280 - * TODO rework base driver to use values directly. 281 - * for now parse it back into reg-format 282 - */ 283 - dc_stream_get_scanoutpos(acrtc->dm_irq_params.stream, 284 - &v_blank_start, 285 - &v_blank_end, 286 - &h_position, 287 - &v_position); 288 - 289 - *position = v_position | (h_position << 16); 290 - *vbl = v_blank_start | (v_blank_end << 16); 274 + if (!acrtc->dm_irq_params.stream) { 275 + DRM_ERROR("dc_stream_state is NULL for crtc '%d'!\n", 276 + crtc); 277 + return 0; 291 278 } 279 + 280 + /* 281 + * TODO rework base driver to use values directly. 282 + * for now parse it back into reg-format 283 + */ 284 + dc_stream_get_scanoutpos(acrtc->dm_irq_params.stream, 285 + &v_blank_start, 286 + &v_blank_end, 287 + &h_position, 288 + &v_position); 289 + 290 + *position = v_position | (h_position << 16); 291 + *vbl = v_blank_start | (v_blank_end << 16); 292 292 293 293 return 0; 294 294 }