[radeon-alex:amd-mainline-dkms-4.15 1231/1759] drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:2183 fill_plane_attributes() warn: if statement not indented

Dan Carpenter dan.carpenter at oracle.com
Thu Apr 26 12:54:17 UTC 2018


tree:   git://people.freedesktop.org/~agd5f/linux.git amd-mainline-dkms-4.15
head:   9556f93f18f7923978fb90f860c107fed9ca7f57
commit: 265083076187e619aa9176aeb05ad630013429b4 [1231/1759] drm/amd/display: Hookup color management functions

smatch warnings:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:2183 fill_plane_attributes() warn: if statement not indented

git remote add radeon-alex git://people.freedesktop.org/~agd5f/linux.git
git remote update radeon-alex
git checkout 265083076187e619aa9176aeb05ad630013429b4
vim +2183 drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c

e7b07ceef Harry Wentland   2017-08-10  2143  
3ee6b26b7 Alex Deucher     2017-10-10  2144  static int fill_plane_attributes(struct amdgpu_device *adev,
3be5262e3 Harry Wentland   2017-07-27  2145  				 struct dc_plane_state *dc_plane_state,
e7b07ceef Harry Wentland   2017-08-10  2146  				 struct drm_plane_state *plane_state,
ab8968728 Michel Dänzer    2017-10-26  2147  				 struct drm_crtc_state *crtc_state)
e7b07ceef Harry Wentland   2017-08-10  2148  {
e7b07ceef Harry Wentland   2017-08-10  2149  	const struct amdgpu_framebuffer *amdgpu_fb =
e7b07ceef Harry Wentland   2017-08-10  2150  		to_amdgpu_framebuffer(plane_state->fb);
25b138493 Roger He         2018-02-26  2151  #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0) || \
25b138493 Roger He         2018-02-26  2152  	defined(OS_NAME_RHEL_7_3) || \
25b138493 Roger He         2018-02-26  2153  	defined(OS_NAME_RHEL_7_4_5)
e7b07ceef Harry Wentland   2017-08-10  2154  	const struct drm_crtc *crtc = plane_state->crtc;
30b13a59d Junwei Zhang     2018-02-08  2155  #else
30b13a59d Junwei Zhang     2018-02-08  2156  	struct drm_crtc *crtc = plane_state->crtc;
30b13a59d Junwei Zhang     2018-02-08  2157  #endif
e7b07ceef Harry Wentland   2017-08-10  2158  	struct dc_transfer_func *input_tf;
e7b07ceef Harry Wentland   2017-08-10  2159  	int ret = 0;
e7b07ceef Harry Wentland   2017-08-10  2160  
3be5262e3 Harry Wentland   2017-07-27  2161  	if (!fill_rects_from_plane_state(plane_state, dc_plane_state))
e7b07ceef Harry Wentland   2017-08-10  2162  		return -EINVAL;
e7b07ceef Harry Wentland   2017-08-10  2163  
e7b07ceef Harry Wentland   2017-08-10  2164  	ret = fill_plane_attributes_from_fb(
e7b07ceef Harry Wentland   2017-08-10  2165  		crtc->dev->dev_private,
3be5262e3 Harry Wentland   2017-07-27  2166  		dc_plane_state,
ab8968728 Michel Dänzer    2017-10-26  2167  		amdgpu_fb);
e7b07ceef Harry Wentland   2017-08-10  2168  
e7b07ceef Harry Wentland   2017-08-10  2169  	if (ret)
e7b07ceef Harry Wentland   2017-08-10  2170  		return ret;
e7b07ceef Harry Wentland   2017-08-10  2171  
e7b07ceef Harry Wentland   2017-08-10  2172  	input_tf = dc_create_transfer_func();
e7b07ceef Harry Wentland   2017-08-10  2173  
e7b07ceef Harry Wentland   2017-08-10  2174  	if (input_tf == NULL)
e7b07ceef Harry Wentland   2017-08-10  2175  		return -ENOMEM;
e7b07ceef Harry Wentland   2017-08-10  2176  
3be5262e3 Harry Wentland   2017-07-27  2177  	dc_plane_state->in_transfer_func = input_tf;
e7b07ceef Harry Wentland   2017-08-10  2178  
e7b07ceef Harry Wentland   2017-08-10  2179  	/* In case of gamma set, update gamma value */
25b138493 Roger He         2018-02-26  2180  #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0) || \
25b138493 Roger He         2018-02-26  2181  	defined(OS_NAME_RHEL_7_3) || \
25b138493 Roger He         2018-02-26  2182  	defined(OS_NAME_RHEL_7_4_5)
e7b07ceef Harry Wentland   2017-08-10 @2183  	if (crtc_state->gamma_lut)
265083076 Leo (Sunpeng  Li 2018-02-02  2184) 	/*
265083076 Leo (Sunpeng  Li 2018-02-02  2185) 	 * Always set input transfer function, since plane state is refreshed
265083076 Leo (Sunpeng  Li 2018-02-02  2186) 	 * every time.
265083076 Leo (Sunpeng  Li 2018-02-02  2187) 	 */
265083076 Leo (Sunpeng  Li 2018-02-02  2188) 	ret = amdgpu_dm_set_degamma_lut(crtc_state, dc_plane_state);

It should be indented and I would normally use curly braces around the
whole thing as well for readability.

3f4b5749a Junwei Zhang     2018-02-07  2189  #else
3f4b5749a Junwei Zhang     2018-02-07  2190  	if (crtc->mode.private_flags & AMDGPU_CRTC_MODE_PRIVATE_FLAGS_GAMMASET) {
3f4b5749a Junwei Zhang     2018-02-07  2191  		fill_gamma_from_crtc(crtc, dc_plane_state);
3f4b5749a Junwei Zhang     2018-02-07  2192  		/* reset trigger of gamma */
3f4b5749a Junwei Zhang     2018-02-07  2193  		crtc->mode.private_flags &=
3f4b5749a Junwei Zhang     2018-02-07  2194  			~AMDGPU_CRTC_MODE_PRIVATE_FLAGS_GAMMASET;
3f4b5749a Junwei Zhang     2018-02-07  2195  	}
3f4b5749a Junwei Zhang     2018-02-07  2196  #endif
e7b07ceef Harry Wentland   2017-08-10  2197  
e7b07ceef Harry Wentland   2017-08-10  2198  	return ret;
e7b07ceef Harry Wentland   2017-08-10  2199  }
e7b07ceef Harry Wentland   2017-08-10  2200  

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation


More information about the dri-devel mailing list