[igt-dev] [PATCH i-g-t 4/7] lib/intel_aux_pgtable: Fix uint64_t vs. long mismatch

Ville Syrjala ville.syrjala at linux.intel.com
Tue Jan 14 14:25:20 UTC 2020


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

../lib/intel_aux_pgtable.c: In function ‘ptr_mask’:
../lib/intel_aux_pgtable.c:14:12: warning: right shift count >= width of type [-Wshift-count-overflow]
   14 |      (~0UL >> (BITS_PER_LONG - 1 - (e))))
      |            ^~
../lib/intel_aux_pgtable.c:138:9: note: in expansion of macro ‘BITMASK’
  138 |  return BITMASK(GFX_ADDRESS_BITS - 1, ld->entry_ptr_shift);
      |         ^~~~~~~

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 lib/intel_aux_pgtable.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/intel_aux_pgtable.c b/lib/intel_aux_pgtable.c
index fcd24f087c12..db5055c820ec 100644
--- a/lib/intel_aux_pgtable.c
+++ b/lib/intel_aux_pgtable.c
@@ -9,9 +9,9 @@
 
 #include "i915/gem_mman.h"
 
-#define BITS_PER_LONG		(sizeof(long) * 8)
-#define BITMASK(e, s)		((~0UL << (s)) & \
-				 (~0UL >> (BITS_PER_LONG - 1 - (e))))
+#define BITS_PER_LONG_LONG	(sizeof(long long) * 8)
+#define BITMASK(e, s)		((~0ULL << (s)) & \
+				 (~0ULL >> (BITS_PER_LONG_LONG - 1 - (e))))
 
 /* The unit size to which the AUX CCS surface is aligned to. */
 #define AUX_CCS_UNIT_SIZE	64
-- 
2.24.1



More information about the igt-dev mailing list