[PATCH] drm/radeon: Fix an always-false-comparison

'Liu Yuan namei.unix at gmail.com
Thu Mar 31 22:12:17 PDT 2011


From: Liu Yuan <tailai.ly at taobao.com>

In the function atom_op_delay() of drivers/gpu/drm/radeon/atom.c,
the comparison performed in the udelay() is always false due to
that the unsigned-char is compared to an integer 20000.

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 drivers/gpu/drm/radeon/atom.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
index 258fa5e..e248211 100644
--- a/drivers/gpu/drm/radeon/atom.c
+++ b/drivers/gpu/drm/radeon/atom.c
@@ -648,7 +648,7 @@ static void atom_op_compare(atom_exec_context *ctx, int *ptr, int arg)
 
 static void atom_op_delay(atom_exec_context *ctx, int *ptr, int arg)
 {
-	uint8_t count = U8((*ptr)++);
+	uint32_t count = U32((*ptr)++);
 	SDEBUG("   count: %d\n", count);
 	if (arg == ATOM_UNIT_MICROSEC)
 		udelay(count);
-- 
1.7.1



More information about the dri-devel mailing list