diff mbox

[1/2] drm/i915: Silence sparse by using gfp_t

Message ID 20170901145729.21363-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson Sept. 1, 2017, 2:57 p.m. UTC
Sparse enforces that GFP flags are only manipulated inside gfp_t locals.

Fixes: 4d470f7359c4 ("drm/i915: Avoid undefined behaviour of "u32 >> 32"")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ville Syrjala Sept. 1, 2017, 3:21 p.m. UTC | #1
On Fri, Sep 01, 2017 at 03:57:28PM +0100, Chris Wilson wrote:
> Sparse enforces that GFP flags are only manipulated inside gfp_t locals.
> 
> Fixes: 4d470f7359c4 ("drm/i915: Avoid undefined behaviour of "u32 >> 32"")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/i915_gem_execbuffer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> index 8a9d37ac16d4..67317b79b9e0 100644
> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> @@ -290,7 +290,7 @@ static int eb_create(struct i915_execbuffer *eb)
>  		 * direct lookup.
>  		 */
>  		do {
> -			unsigned int flags;
> +			gfp_t flags;
>  
>  			/* While we can still reduce the allocation size, don't
>  			 * raise a warning and allow the allocation to fail.
> -- 
> 2.14.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Joonas Lahtinen Sept. 4, 2017, 6:50 a.m. UTC | #2
On Fri, 2017-09-01 at 15:57 +0100, Chris Wilson wrote:
> Sparse enforces that GFP flags are only manipulated inside gfp_t locals.
> 
> Fixes: 4d470f7359c4 ("drm/i915: Avoid undefined behaviour of "u32 >> 32"")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Isn't Fixes: bit much for sparse warning?

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Regards, Joonas
Chris Wilson Sept. 4, 2017, 11:08 a.m. UTC | #3
Quoting Joonas Lahtinen (2017-09-04 07:50:38)
> On Fri, 2017-09-01 at 15:57 +0100, Chris Wilson wrote:
> > Sparse enforces that GFP flags are only manipulated inside gfp_t locals.
> > 
> > Fixes: 4d470f7359c4 ("drm/i915: Avoid undefined behaviour of "u32 >> 32"")
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Isn't Fixes: bit much for sparse warning?
Impact: None ?
-Chris
Joonas Lahtinen Sept. 18, 2017, 1:19 p.m. UTC | #4
On Mon, 2017-09-04 at 12:08 +0100, Chris Wilson wrote:
> Quoting Joonas Lahtinen (2017-09-04 07:50:38)
> > On Fri, 2017-09-01 at 15:57 +0100, Chris Wilson wrote:
> > > Sparse enforces that GFP flags are only manipulated inside gfp_t locals.
> > > 
> > > Fixes: 4d470f7359c4 ("drm/i915: Avoid undefined behaviour of "u32 >> 32"")
> > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > 
> > Isn't Fixes: bit much for sparse warning?
> 
> Impact: None ?

Well, "Impact: Cosmetic" would be more truthful but complex.

"Backport: None" ?

Could also take the value that is currently causing grief in the Cc:
stable line;

"Backport: v4.8+"

Regards, Joonas
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 8a9d37ac16d4..67317b79b9e0 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -290,7 +290,7 @@  static int eb_create(struct i915_execbuffer *eb)
 		 * direct lookup.
 		 */
 		do {
-			unsigned int flags;
+			gfp_t flags;
 
 			/* While we can still reduce the allocation size, don't
 			 * raise a warning and allow the allocation to fail.