drm/i915: switch ring->id to be a real id
Subsystems (2)
Hello Daniel Vetter,
The patch 96154f2faba5: "drm/i915: switch ring->id to be a real id" from Dec 14, 2011, leads to the following warning:drivers/gpu/drm/i915/i915_debugfs.c:688 print_error_buffers()
error: err->ring is never equal to -1 (wrong type 0 - 15).
@@ -724,6 +724,7 @@ static void print_error_buffers(struct seq_file *m,
tiling_flag(err->tiling),
dirty_flag(err->dirty),
purgeable_flag(err->purgeable),
+ err->ring != -1 ? " " : "",
^^^^^^^^^^^^^^^->ring is an unsigned bitfield so it's never equal to -1.
ring_str(err->ring),
cache_level_str(err->cache_level));regards,
dan carpenter
PATCH 1/1 drm/i915: error_buffer->ring should be signed
gcc seems to get uber-anal recently about these things.
--- drivers/gpu/drm/i915/i915_drv.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +1 -1
@@ -199,7 +199,7 @@ struct drm_i915_error_state { u32 tiling:2; u32 dirty:1; u32 purgeable:1; - u32 ring:4; + s32 ring:4; u32 cache_level:2; } *active_bo, *pinned_bo;u32 active_bo_count, pinned_bo_count;
Signature · 1 line
1.7.9
Re: [PATCH] drm/i915: error_buffer->ring should be signed
Am Donnerstag, den 16.02.2012, 11:03 +0100 schrieb Daniel Vetter:
Quoted 1 line
gcc seems to get uber-anal recently about these things.
which was introduced by the following commit.
96154f2faba5: "drm/i915: switch ring->id to be a real id"
Quoted 1 line
Reported-by Dan Carpenter <[email protected]>
The URL of the report is the following.
http://lists.freedesktop.org/archives/dri-devel/2012-February/019183.html
Quoted 1 line
Signed-off-by Daniel Vetter <[email protected]>
Quoted 9 lines
--- drivers/gpu/drm/i915/i915_drv.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/gpu/drm/i915/i915_drv.h +0
-0
drivers/gpu/drm/i915/i915_drv.h struct drm_i915_error_state { · line 205
Quoted 8 lines
drivers/gpu/drm/i915/i915_drv.h +1
-1@@ -199,7 +199,7 @@ struct drm_i915_error_state { u32 tiling:2; u32 dirty:1; u32 purgeable:1; - u32 ring:4; + s32 ring:4; u32 cache_level:2; } *active_bo, *pinned_bo;u32 active_bo_count, pinned_bo_count;
Thanks,
Paul
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/i915: error_buffer->ring should be signed
In reply to Daniel VetterQuoted 2 lines · Daniel Vetter
gcc seems to get uber-anal recently about these things.
Sorry, I should have said that it's not a gcc warning, it's a smatch thing. But also it's not uber-anal. It's the exact level of anality which is required to make the == -1 test work. You can compare unsigned int and longs to -1 and it works but for smaller types it doesn't.
regards,
dan carpenter
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Daniel Vetter
AppliedRe: [PATCH] drm/i915: error_buffer->ring should be signed
Quoted 9 lines · Dan Carpenter
Quoted 2 lines · Daniel Vetter
gcc seems to get uber-anal recently about these things.
Sorry, I should have said that it's not a gcc warning, it's a smatch thing. But also it's not uber-anal. It's the exact level of anality which is required to make the == -1 test work. You can compare unsigned int and longs to -1 and it works but for smaller types it doesn't.
I've picked this one here up for -next, thanks for your clarification (added to the commit message in).
-Daniel
Signature · 3 lines
Daniel Vetter Mail: [email protected] Mobile: +41 (0)79 365 57 48