* [PATCH v2] drm: drm_memory: fix compiler warning on 32-bit targets
@ 2018-02-19 23:08 David Lechner
2018-02-20 10:49 ` Thierry Reding
0 siblings, 1 reply; 2+ messages in thread
From: David Lechner @ 2018-02-19 23:08 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 resource_size_t, 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 resource_size_t 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..3c54044 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;
+ resource_size_t 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 v2] drm: drm_memory: fix compiler warning on 32-bit targets
2018-02-19 23:08 [PATCH v2] drm: drm_memory: fix compiler warning on 32-bit targets David Lechner
@ 2018-02-20 10:49 ` Thierry Reding
0 siblings, 0 replies; 2+ messages in thread
From: Thierry Reding @ 2018-02-20 10:49 UTC (permalink / raw)
To: David Lechner
Cc: Alex Deucher, Monk Liu, Michel Dänzer, Christian König,
dri-devel
[-- Attachment #1.1: Type: text/plain, Size: 425 bytes --]
On Mon, Feb 19, 2018 at 05:08:54PM -0600, David Lechner wrote:
> The end field of struct resource is resource_size_t, so on 32-bit
> targets, this is a 32-bit value.
That's not quite correct. resource_size_t is a phys_addr_t, which can be
64-bit also on 32-bit targets (if they've got CONFIG_PHYS_ADDR_T_64BIT
enabled, which is used for example with PAE).
With that fixed:
Reviewed-by: Thierry Reding <treding@nvidia.com>
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
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-20 10:49 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:08 [PATCH v2] drm: drm_memory: fix compiler warning on 32-bit targets David Lechner
2018-02-20 10:49 ` Thierry Reding
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.