mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
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:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user