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>
This commit is contained in:
Tony Cheng
2017-01-14 01:44:52 -05:00
committed by Alex Deucher
parent f84a8161cb
commit bf72726358

View File

@@ -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));
}