From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@01.org, "Leo (Sunpeng) Li" <sunpeng.li@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>,
Kevin Wang <Kevin1.Wang@amd.com>,
Harry Wentland <Harry.Wentland@amd.com>,
kbuild-all@01.org, dri-devel@lists.freedesktop.org
Subject: [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
Date: Thu, 26 Apr 2018 15:54:17 +0300 [thread overview]
Message-ID: <20180426125417.copld3cfbebmhitf@mwanda> (raw)
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
next reply other threads:[~2018-04-26 12:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-26 12:54 Dan Carpenter [this message]
2018-04-26 14:46 ` [PATCH] drm/amd/display: Remove erroneous if statement in gamma set sunpeng.li
2018-04-26 18:17 ` Harry Wentland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180426125417.copld3cfbebmhitf@mwanda \
--to=dan.carpenter@oracle.com \
--cc=Harry.Wentland@amd.com \
--cc=Kevin1.Wang@amd.com \
--cc=alexander.deucher@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kbuild-all@01.org \
--cc=kbuild@01.org \
--cc=sunpeng.li@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox