blob: aa67babb0e11a557a1ebdb4a2f763b94f776ab70 [file] [log] [blame]
From b8e1c80dbcf72d64d52b22ac2296de93d251a02a Mon Sep 17 00:00:00 2001
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Fri, 20 Sep 2013 14:20:18 +0300
Subject: drm/i915: cleanup a min_t() cast
The lower layers of sysfs will not allow an "offset" of more than
GEN7_L3LOG_SIZE and also l3_access_valid() caps it a second time. But
it's a little easier to audit if we don't have to worry that the
subtraction will result in negative values.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
(cherry picked from commit e5ad4026b9270532bfbc2fcb73cc74fbb46887d1)
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
drivers/gpu/drm/i915/i915_sysfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
index 176de441002c..44f4c1a6f7b1 100644
--- a/drivers/gpu/drm/i915/i915_sysfs.c
+++ b/drivers/gpu/drm/i915/i915_sysfs.c
@@ -131,7 +131,7 @@ i915_l3_read(struct file *filp, struct kobject *kobj,
if (ret)
return ret;
- count = min_t(int, GEN7_L3LOG_SIZE-offset, count);
+ count = min_t(size_t, GEN7_L3LOG_SIZE - offset, count);
ret = i915_mutex_lock_interruptible(drm_dev);
if (ret)
--
1.8.5.rc3