Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] [v2] i915: fix shift warning
@ 2021-01-03 13:51 Arnd Bergmann
  2021-01-03 14:01 ` Chris Wilson
  2021-01-04 17:37 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for i915: fix shift warning (rev2) Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2021-01-03 13:51 UTC (permalink / raw)
  To: Chris Wilson, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	David Airlie, Daniel Vetter
  Cc: Arnd Bergmann, intel-gfx, linux-kernel, dri-devel, Matthew Auld,
	Dave Airlie

From: Arnd Bergmann <arnd@arndb.de>

Randconfig builds on 32-bit machines show lots of warnings for
the i915 driver for passing a 32-bit value into __const_hweight64():

drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:2584:9: error: shift count >= width of type [-Werror,-Wshift-count-overflow]
        return hweight64(VDBOX_MASK(&i915->gt));
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/bitops/const_hweight.h:29:49: note: expanded from macro 'hweight64'
 #define hweight64(w) (__builtin_constant_p(w) ? __const_hweight64(w) : __arch_hweight64(w))

Change it to hweight_long() to avoid the warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index bcc80f428172..43164a0b0023 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -2581,7 +2581,7 @@ static int eb_submit(struct i915_execbuffer *eb, struct i915_vma *batch)
 
 static int num_vcs_engines(const struct drm_i915_private *i915)
 {
-	return hweight64(VDBOX_MASK(&i915->gt));
+	return hweight_long(VDBOX_MASK(&i915->gt));
 }
 
 /*
-- 
2.29.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Intel-gfx] [PATCH] [v2] i915: fix shift warning
  2021-01-03 13:51 [Intel-gfx] [PATCH] [v2] i915: fix shift warning Arnd Bergmann
@ 2021-01-03 14:01 ` Chris Wilson
  2021-01-04 17:37 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for i915: fix shift warning (rev2) Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Chris Wilson @ 2021-01-03 14:01 UTC (permalink / raw)
  To: Arnd Bergmann, Daniel Vetter, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi
  Cc: Arnd Bergmann, intel-gfx, linux-kernel, dri-devel, Matthew Auld,
	Dave Airlie

Quoting Arnd Bergmann (2021-01-03 13:51:44)
> From: Arnd Bergmann <arnd@arndb.de>
> 
> Randconfig builds on 32-bit machines show lots of warnings for
> the i915 driver for passing a 32-bit value into __const_hweight64():
> 
> drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:2584:9: error: shift count >= width of type [-Werror,-Wshift-count-overflow]
>         return hweight64(VDBOX_MASK(&i915->gt));
>                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/asm-generic/bitops/const_hweight.h:29:49: note: expanded from macro 'hweight64'
>  #define hweight64(w) (__builtin_constant_p(w) ? __const_hweight64(w) : __arch_hweight64(w))
> 
> Change it to hweight_long() to avoid the warning.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by:: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Intel-gfx] ✗ Fi.CI.BAT: failure for i915: fix shift warning (rev2)
  2021-01-03 13:51 [Intel-gfx] [PATCH] [v2] i915: fix shift warning Arnd Bergmann
  2021-01-03 14:01 ` Chris Wilson
@ 2021-01-04 17:37 ` Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2021-01-04 17:37 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: intel-gfx


[-- Attachment #1.1: Type: text/plain, Size: 427 bytes --]

== Series Details ==

Series: i915: fix shift warning (rev2)
URL   : https://patchwork.freedesktop.org/series/85448/
State : failure

== Summary ==

Applying: i915: fix shift warning
Using index info to reconstruct a base tree...
M	drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
Falling back to patching base and 3-way merge...
Auto-merging drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
No changes -- Patch already applied.



[-- Attachment #1.2: Type: text/html, Size: 927 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-04 17:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-03 13:51 [Intel-gfx] [PATCH] [v2] i915: fix shift warning Arnd Bergmann
2021-01-03 14:01 ` Chris Wilson
2021-01-04 17:37 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for i915: fix shift warning (rev2) Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox