[Intel-gfx] [PATCH] drm/i915: fix command parser debug print format mismatches

2014-04-03 Thread Damien Lespiau
On Thu, Apr 03, 2014 at 11:32:30AM +0200, Daniel Vetter wrote:
> On Wed, Apr 02, 2014 at 08:26:23AM -0700, Randy Dunlap wrote:
> > On 04/02/2014 01:24 AM, Jani Nikula wrote:
> > > Drop the cast from the pointer diff to fix:
> > > 
> > > drivers/gpu/drm/i915/i915_cmd_parser.c:405:4: warning: format '%td' 
> > > expects
> > > argument of type 'ptrdiff_t', but argument 5 has type 'long unsigned int'
> > > [-Wformat]
> > > 
> > > While at it, use %u for u32.
> > > 
> > > Reported-by: Randy Dunlap 
> > > Signed-off-by: Jani Nikula 
> > > 
> > > ---
> > > 
> > > Randy, try as I might, I wasn't able to coerce gcc to spit out that
> > > warning. Please enlighten me! (Does this fix the warn?)
> > 
> > Yes, it does.  Thanks.
> > 
> > Acked-by: Randy Dunlap 
> 
> Maybe I'm blind, but I think the recent refactoring patch fixed this. Can
> someone please double-check? I always get confused with printf formats ;-)

I fixed it a couple of weeks back:
  http://lists.freedesktop.org/archives/intel-gfx/2014-March/041886.html

-- 
Damien


[Intel-gfx] [PATCH] drm/i915: fix command parser debug print format mismatches

2014-04-03 Thread Daniel Vetter
On Wed, Apr 02, 2014 at 08:26:23AM -0700, Randy Dunlap wrote:
> On 04/02/2014 01:24 AM, Jani Nikula wrote:
> > Drop the cast from the pointer diff to fix:
> > 
> > drivers/gpu/drm/i915/i915_cmd_parser.c:405:4: warning: format '%td' expects
> > argument of type 'ptrdiff_t', but argument 5 has type 'long unsigned int'
> > [-Wformat]
> > 
> > While at it, use %u for u32.
> > 
> > Reported-by: Randy Dunlap 
> > Signed-off-by: Jani Nikula 
> > 
> > ---
> > 
> > Randy, try as I might, I wasn't able to coerce gcc to spit out that
> > warning. Please enlighten me! (Does this fix the warn?)
> 
> Yes, it does.  Thanks.
> 
> Acked-by: Randy Dunlap 

Maybe I'm blind, but I think the recent refactoring patch fixed this. Can
someone please double-check? I always get confused with printf formats ;-)

Thanks, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch


[PATCH] drm/i915: fix command parser debug print format mismatches

2014-04-02 Thread Jani Nikula
Drop the cast from the pointer diff to fix:

drivers/gpu/drm/i915/i915_cmd_parser.c:405:4: warning: format '%td' expects
argument of type 'ptrdiff_t', but argument 5 has type 'long unsigned int'
[-Wformat]

While at it, use %u for u32.

Reported-by: Randy Dunlap 
Signed-off-by: Jani Nikula 

---

Randy, try as I might, I wasn't able to coerce gcc to spit out that
warning. Please enlighten me! (Does this fix the warn?)

Thanks for the report.
---
 drivers/gpu/drm/i915/i915_cmd_parser.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_cmd_parser.c 
b/drivers/gpu/drm/i915/i915_cmd_parser.c
index 71ac3b4eaa0d..e5c4e99a22fb 100644
--- a/drivers/gpu/drm/i915/i915_cmd_parser.c
+++ b/drivers/gpu/drm/i915/i915_cmd_parser.c
@@ -811,10 +811,10 @@ int i915_parse_cmds(struct intel_ring_buffer *ring,
length = ((*cmd & desc->length.mask) + LENGTH_BIAS);

if ((batch_end - cmd) < length) {
-   DRM_DEBUG_DRIVER("CMD: Command length exceeds batch 
length: 0x%08X length=%d batchlen=%td\n",
+   DRM_DEBUG_DRIVER("CMD: Command length exceeds batch 
length: 0x%08X length=%u batchlen=%td\n",
 *cmd,
 length,
-(unsigned long)(batch_end - cmd));
+batch_end - cmd);
ret = -EINVAL;
break;
}
-- 
1.7.9.5



[PATCH] drm/i915: fix command parser debug print format mismatches

2014-04-02 Thread Randy Dunlap
On 04/02/2014 01:24 AM, Jani Nikula wrote:
> Drop the cast from the pointer diff to fix:
> 
> drivers/gpu/drm/i915/i915_cmd_parser.c:405:4: warning: format '%td' expects
> argument of type 'ptrdiff_t', but argument 5 has type 'long unsigned int'
> [-Wformat]
> 
> While at it, use %u for u32.
> 
> Reported-by: Randy Dunlap 
> Signed-off-by: Jani Nikula 
> 
> ---
> 
> Randy, try as I might, I wasn't able to coerce gcc to spit out that
> warning. Please enlighten me! (Does this fix the warn?)

Yes, it does.  Thanks.

Acked-by: Randy Dunlap 


> Thanks for the report.
> ---
>  drivers/gpu/drm/i915/i915_cmd_parser.c |4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_cmd_parser.c 
> b/drivers/gpu/drm/i915/i915_cmd_parser.c
> index 71ac3b4eaa0d..e5c4e99a22fb 100644
> --- a/drivers/gpu/drm/i915/i915_cmd_parser.c
> +++ b/drivers/gpu/drm/i915/i915_cmd_parser.c
> @@ -811,10 +811,10 @@ int i915_parse_cmds(struct intel_ring_buffer *ring,
>   length = ((*cmd & desc->length.mask) + LENGTH_BIAS);
>  
>   if ((batch_end - cmd) < length) {
> - DRM_DEBUG_DRIVER("CMD: Command length exceeds batch 
> length: 0x%08X length=%d batchlen=%td\n",
> + DRM_DEBUG_DRIVER("CMD: Command length exceeds batch 
> length: 0x%08X length=%u batchlen=%td\n",
>*cmd,
>length,
> -  (unsigned long)(batch_end - cmd));
> +  batch_end - cmd);
>   ret = -EINVAL;
>   break;
>   }
> 


-- 
~Randy