Skip to content

Commit

Permalink
drm/i915: cleanup a min_t() cast
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Daniel Vetter committed Sep 20, 2013
1 parent d631729 commit e5ad402
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/i915_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e5ad402

Please sign in to comment.