summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Cheng <tony.cheng@amd.com>2017-01-14 01:44:52 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-09-26 17:10:12 -0400
commitbf72726358adfedcf1c268690521891809332151 (patch)
treeda7bad4a95c74f8296ee8f7de4265072c6f54223
parentf84a8161cb1652281746d113667427dbbf8bd5db (diff)
downloadlinux-stable-bf72726358adfedcf1c268690521891809332151.tar.gz
linux-stable-bf72726358adfedcf1c268690521891809332151.tar.bz2
linux-stable-bf72726358adfedcf1c268690521891809332151.zip
drm/amd/display: assert if mask is 0 in set_reg_field_value_ex
- mask = 0 means something is wrong in caller and no register field will be updated Signed-off-by: Tony Cheng <tony.cheng@amd.com> Reviewed-by: Harry Wentland <Harry.Wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/display/dc/dm_services.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dm_services.h b/drivers/gpu/drm/amd/display/dc/dm_services.h
index 11a0abfd3418..052a43af1bd3 100644
--- a/drivers/gpu/drm/amd/display/dc/dm_services.h
+++ b/drivers/gpu/drm/amd/display/dc/dm_services.h
@@ -165,6 +165,7 @@ static inline uint32_t set_reg_field_value_ex(
uint32_t mask,
uint8_t shift)
{
+ ASSERT(mask != 0);
return (reg_value & ~mask) | (mask & (value << shift));
}