* [patch] drm/i915: cleanup a min_t() cast
@ 2013-09-20 11:20 Dan Carpenter
2013-09-20 21:50 ` Daniel Vetter
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2013-09-20 11:20 UTC (permalink / raw)
To: Daniel Vetter; +Cc: David Airlie, intel-gfx, kernel-janitors, dri-devel
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>
diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
index d572435..b3f62b4 100644
--- a/drivers/gpu/drm/i915/i915_sysfs.c
+++ b/drivers/gpu/drm/i915/i915_sysfs.c
@@ -127,7 +127,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)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] drm/i915: cleanup a min_t() cast
2013-09-20 11:20 [patch] drm/i915: cleanup a min_t() cast Dan Carpenter
@ 2013-09-20 21:50 ` Daniel Vetter
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2013-09-20 21:50 UTC (permalink / raw)
To: Dan Carpenter
Cc: Daniel Vetter, David Airlie, intel-gfx, dri-devel,
kernel-janitors
On Fri, Sep 20, 2013 at 02:20:18PM +0300, Dan Carpenter wrote:
> 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>
Queued for -next, thanks for the patch.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-09-20 21:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-20 11:20 [patch] drm/i915: cleanup a min_t() cast Dan Carpenter
2013-09-20 21:50 ` Daniel Vetter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox