All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: drm_memory: fix compiler warning on 32-bit targets
@ 2018-02-19 23:00 David Lechner
  2018-02-19 23:08 ` David Lechner
  0 siblings, 1 reply; 2+ messages in thread
From: David Lechner @ 2018-02-19 23:00 UTC (permalink / raw)
  To: dri-devel
  Cc: David Lechner, Michel Dänzer, Alex Deucher,
	Christian König, Monk Liu

The end field of struct resource is unsigned long, so on 32-bit targets,
this is a 32-bit value. This results in a compiler warning of "warning:
comparison of distinct pointer types lacks a cast". Fix it by making
max_iomem unsigned long to match the end field.

Fixes: (82626363a217 "drm: add func to get max iomem address v2")
Signed-off-by: David Lechner <david@lechnology.com>
---
 drivers/gpu/drm/drm_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_memory.c b/drivers/gpu/drm/drm_memory.c
index 7ca500b..597f496 100644
--- a/drivers/gpu/drm/drm_memory.c
+++ b/drivers/gpu/drm/drm_memory.c
@@ -153,7 +153,7 @@ EXPORT_SYMBOL(drm_legacy_ioremapfree);
 u64 drm_get_max_iomem(void)
 {
 	struct resource *tmp;
-	u64 max_iomem = 0;
+	unsigned long max_iomem = 0;
 
 	for (tmp = iomem_resource.child; tmp; tmp = tmp->sibling) {
 		max_iomem = max(max_iomem,  tmp->end);
-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm: drm_memory: fix compiler warning on 32-bit targets
  2018-02-19 23:00 [PATCH] drm: drm_memory: fix compiler warning on 32-bit targets David Lechner
@ 2018-02-19 23:08 ` David Lechner
  0 siblings, 0 replies; 2+ messages in thread
From: David Lechner @ 2018-02-19 23:08 UTC (permalink / raw)
  To: dri-devel
  Cc: Alex Deucher, Michel Dänzer, Christian König, Monk Liu

On 02/19/2018 05:00 PM, David Lechner wrote:
> The end field of struct resource is unsigned long, so on 32-bit targets,
> this is a 32-bit value. This results in a compiler warning of "warning:
> comparison of distinct pointer types lacks a cast". Fix it by making
> max_iomem unsigned long to match the end field.
> 
> Fixes: (82626363a217 "drm: add func to get max iomem address v2")
> Signed-off-by: David Lechner <david@lechnology.com>
> ---

Superseded by v2. I also made a mistake :-o
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2018-02-19 23:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-19 23:00 [PATCH] drm: drm_memory: fix compiler warning on 32-bit targets David Lechner
2018-02-19 23:08 ` David Lechner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.