[PATCH 08/25] drm/amd/display: assert if mask is 0 in set_reg_field_value_ex
Harry Wentland
harry.wentland at amd.com
Mon Jan 23 14:35:56 UTC 2017
From: Tony Cheng <tony.cheng at amd.com>
- mask = 0 means something is wrong in caller and no register field will be updated
Change-Id: Ib30c28ca30f574c703cd3b6acc42e5a401a9aff0
Signed-off-by: Tony Cheng <tony.cheng at amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland at amd.com>
---
drivers/gpu/drm/amd/display/dc/dm_services.h | 1 +
1 file changed, 1 insertion(+)
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));
}
--
2.9.3
More information about the amd-gfx
mailing list