]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drm/i915: cleanup a min_t() cast
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 20 Sep 2013 11:20:18 +0000 (14:20 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 20 Sep 2013 21:50:01 +0000 (23:50 +0200)
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>
drivers/gpu/drm/i915/i915_sysfs.c

index 176de441002c43a3822e241073c5c7072fb660d4..44f4c1a6f7b109b4691069a9b2b7dc265ad7113f 100644 (file)
@@ -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)