drm/amd/display: assert if mask is 0 in set_reg_field_value_ex
authorTony Cheng <tony.cheng@amd.com>
Sat, 14 Jan 2017 06:44:52 +0000 (01:44 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 21:10:12 +0000 (17:10 -0400)
-  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>
drivers/gpu/drm/amd/display/dc/dm_services.h

index 11a0abf..052a43a 100644 (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));
 }