* [patch] drm/i915: cleanup min_t() casting
@ 2011-10-18 6:07 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2011-10-18 6:07 UTC (permalink / raw)
To: Keith Packard; +Cc: kernel-janitors, dri-devel
Casting "len" from uin32_t to uint8_t in min_t() truncates the upper
bits. It doesn't matter in this case because "len" is never more
than 0x1f, but Smatch warns about it, so let's change it.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 8230cf5..65897be 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -5702,7 +5702,7 @@ static void g4x_write_eld(struct drm_connector *connector,
if (!eld[0])
return;
- len = min_t(uint8_t, eld[2], len);
+ len = min_t(uint32_t, eld[2], len);
DRM_DEBUG_DRIVER("ELD size %d\n", len);
for (i = 0; i < len; i++)
I915_WRITE(G4X_HDMIW_HDMIEDID, *((uint32_t *)eld + i));
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-10-18 6:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-18 6:07 [patch] drm/i915: cleanup min_t() casting Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox