From: Arnd Bergmann <[email protected]>
Checking a large 64-bit constant against a 32-bit dma_addr_t produces a harmless
compiler output when extra warnings are enabled, but leads to a build failure
with -Werror:
drivers/gpu/drm/nouveau/nvkm/subdev/fb/gb202.c:17:37: error: result of
comparison of constant 4503599627370495 with expression of type 'dma_addr_t'
(aka 'unsigned int') is always false
[-Werror,-Wtautological-constant-out-of-range-compare]
17 | WARN_ON(fb->sysmem.flush_page_addr > DMA_BIT_MASK(52));
As the calculations of sysmem.flush_page_addr are mostly done on u64 types
anyway,
change the struct member to the same type. This feels less invasive than
changing
each WARN_ON() to add an extra cast or extended condition to shut up the
warning.
Fixes: 31d3354f42c0 ("drm/nouveau: verify that hardware supports the flush page
address")
Signed-off-by: Arnd Bergmann <[email protected]>
---
drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h
b/drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h
index e0d777a933e1..7b932449606b 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h
@@ -38,7 +38,7 @@ struct nvkm_fb {
struct {
struct page *flush_page;
- dma_addr_t flush_page_addr;
+ u64 flush_page_addr;
} sysmem;
struct nvkm_ram *ram;
--
2.39.5