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
gcc seems to get uber-anal recently about these things.
Reported-by: Dan Carpenter dan.carpenter@oracle.com Signed-off-by: Daniel Vetter daniel.vetter@ffwll.ch --- drivers/gpu/drm/i915/i915_drv.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index b839728..35833fc 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -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;
Am Donnerstag, den 16.02.2012, 11:03 +0100 schrieb Daniel Vetter:
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"
Reported-by: Dan Carpenter dan.carpenter@oracle.com
The URL of the report is the following.
http://lists.freedesktop.org/archives/dri-devel/2012-February/019183.html
Signed-off-by: Daniel Vetter daniel.vetter@ffwll.ch
Acked-by: Paul Menzel paulepanter@users.sourceforge.net
drivers/gpu/drm/i915/i915_drv.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index b839728..35833fc 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -199,7 +199,7 @@ struct drm_i915_error_state { u32 tiling:2; u32 dirty:1; u32 purgeable:1;
u32 ring:4;
u32 cache_level:2; } *active_bo, *pinned_bo; u32 active_bo_count, pinned_bo_count;s32 ring:4;
Thanks,
Paul
On Thu, Feb 16, 2012 at 11:03:29AM +0100, Daniel Vetter wrote:
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
On Thu, Feb 16, 2012 at 02:16:27PM +0300, Dan Carpenter wrote:
On Thu, Feb 16, 2012 at 11:03:29AM +0100, Daniel Vetter wrote:
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
dri-devel@lists.freedesktop.org