2008-12-18 23:06:27

by Hannes Eder

[permalink] [raw]
Subject: [PATCH 1/6] drm/i915: fix sparse warnings: declare one-bit bitfield as unsigned

Fix this sparse warnings:

drivers/gpu/drm/i915/i915_drv.h:169:22: error: dubious one-bit signed bitfield
drivers/gpu/drm/i915/i915_drv.h:169:22: warning: dubious bitfield without explicit `signed' or `unsigned'
drivers/gpu/drm/i915/i915_drv.h:170:19: error: dubious one-bit signed bitfield
drivers/gpu/drm/i915/i915_drv.h:170:19: warning: dubious bitfield without explicit `signed' or `unsigned'
drivers/gpu/drm/i915/i915_drv.h:171:16: error: dubious one-bit signed bitfield
drivers/gpu/drm/i915/i915_drv.h:171:16: warning: dubious bitfield without explicit `signed' or `unsigned'
drivers/gpu/drm/i915/i915_drv.h:172:23: error: dubious one-bit signed bitfield
drivers/gpu/drm/i915/i915_drv.h:172:23: warning: dubious bitfield without explicit `signed' or `unsigned'

Signed-off-by: Hannes Eder <[email protected]>
---
drivers/gpu/drm/i915/i915_drv.h | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 467572a..a640bcf 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -166,10 +166,10 @@ typedef struct drm_i915_private {
struct drm_display_mode *vbt_mode; /* if any */

/* Feature bits from the VBIOS */
- int int_tv_support:1;
- int lvds_dither:1;
- int lvds_vbt:1;
- int int_crt_support:1;
+ unsigned int int_tv_support:1;
+ unsigned int lvds_dither:1;
+ unsigned int lvds_vbt:1;
+ unsigned int int_crt_support:1;

struct drm_i915_fence_reg fence_regs[16]; /* assume 965 */
int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */
--
1.5.6.3


2008-12-18 23:41:00

by Jesse Barnes

[permalink] [raw]
Subject: Re: [PATCH 1/6] drm/i915: fix sparse warnings: declare one-bit bitfield as unsigned

On Thursday, December 18, 2008 6:09 am Hannes Eder wrote:
> Fix this sparse warnings:
>
> drivers/gpu/drm/i915/i915_drv.h:169:22: error: dubious one-bit signed
> bitfield drivers/gpu/drm/i915/i915_drv.h:169:22: warning: dubious bitfield
> without explicit `signed' or `unsigned'
> drivers/gpu/drm/i915/i915_drv.h:170:19: error: dubious one-bit signed
> bitfield drivers/gpu/drm/i915/i915_drv.h:170:19: warning: dubious bitfield
> without explicit `signed' or `unsigned'
> drivers/gpu/drm/i915/i915_drv.h:171:16: error: dubious one-bit signed
> bitfield drivers/gpu/drm/i915/i915_drv.h:171:16: warning: dubious bitfield
> without explicit `signed' or `unsigned'
> drivers/gpu/drm/i915/i915_drv.h:172:23: error: dubious one-bit signed
> bitfield drivers/gpu/drm/i915/i915_drv.h:172:23: warning: dubious bitfield
> without explicit `signed' or `unsigned'
>
> Signed-off-by: Hannes Eder <[email protected]>
> ---
> drivers/gpu/drm/i915/i915_drv.h | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h
> b/drivers/gpu/drm/i915/i915_drv.h index 467572a..a640bcf 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -166,10 +166,10 @@ typedef struct drm_i915_private {
> struct drm_display_mode *vbt_mode; /* if any */
>
> /* Feature bits from the VBIOS */
> - int int_tv_support:1;
> - int lvds_dither:1;
> - int lvds_vbt:1;
> - int int_crt_support:1;
> + unsigned int int_tv_support:1;
> + unsigned int lvds_dither:1;
> + unsigned int lvds_vbt:1;
> + unsigned int int_crt_support:1;
>
> struct drm_i915_fence_reg fence_regs[16]; /* assume 965 */
> int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */

Acked-by: Jesse Barnes <[email protected]>

--
Jesse Barnes, Intel Open Source Technology Center