[PATCH 08/25] drm/amd/display: assert if mask is 0 in set_reg_field_value_ex

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Tony Cheng <tony.cheng@xxxxxxx>

-  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



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux