Commit a4c4f360 authored by Ioana Radulescu's avatar Ioana Radulescu Committed by Greg Kroah-Hartman

staging: fsl-mc/dpio: Fix incorrect casts

The DPIO driver incorrectly assumes virtual addresses are always
64b long, which causes compiler errors when building for a 32b
platform.

Fix this by using explicit casts to uintptr_t where necessary.
Signed-off-by: default avatarIoana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e1a74185
...@@ -192,7 +192,7 @@ irqreturn_t dpaa2_io_irq(struct dpaa2_io *obj) ...@@ -192,7 +192,7 @@ irqreturn_t dpaa2_io_irq(struct dpaa2_io *obj)
u64 q64; u64 q64;
q64 = qbman_result_SCN_ctx(dq); q64 = qbman_result_SCN_ctx(dq);
ctx = (void *)q64; ctx = (void *)(uintptr_t)q64;
ctx->cb(ctx); ctx->cb(ctx);
} else { } else {
pr_crit("fsl-mc-dpio: Unrecognised/ignored DQRR entry\n"); pr_crit("fsl-mc-dpio: Unrecognised/ignored DQRR entry\n");
...@@ -237,7 +237,7 @@ int dpaa2_io_service_register(struct dpaa2_io *d, ...@@ -237,7 +237,7 @@ int dpaa2_io_service_register(struct dpaa2_io *d,
return -ENODEV; return -ENODEV;
ctx->dpio_id = d->dpio_desc.dpio_id; ctx->dpio_id = d->dpio_desc.dpio_id;
ctx->qman64 = (u64)ctx; ctx->qman64 = (u64)(uintptr_t)ctx;
ctx->dpio_private = d; ctx->dpio_private = d;
spin_lock_irqsave(&d->lock_notifications, irqflags); spin_lock_irqsave(&d->lock_notifications, irqflags);
list_add(&ctx->node, &d->notifications); list_add(&ctx->node, &d->notifications);
......
...@@ -497,7 +497,7 @@ void qbman_pull_desc_set_storage(struct qbman_pull_desc *d, ...@@ -497,7 +497,7 @@ void qbman_pull_desc_set_storage(struct qbman_pull_desc *d,
int stash) int stash)
{ {
/* save the virtual address */ /* save the virtual address */
d->rsp_addr_virt = (u64)storage; d->rsp_addr_virt = (u64)(uintptr_t)storage;
if (!storage) { if (!storage) {
d->verb &= ~(1 << QB_VDQCR_VERB_RLS_SHIFT); d->verb &= ~(1 << QB_VDQCR_VERB_RLS_SHIFT);
...@@ -590,7 +590,7 @@ int qbman_swp_pull(struct qbman_swp *s, struct qbman_pull_desc *d) ...@@ -590,7 +590,7 @@ int qbman_swp_pull(struct qbman_swp *s, struct qbman_pull_desc *d)
atomic_inc(&s->vdq.available); atomic_inc(&s->vdq.available);
return -EBUSY; return -EBUSY;
} }
s->vdq.storage = (void *)d->rsp_addr_virt; s->vdq.storage = (void *)(uintptr_t)d->rsp_addr_virt;
p = qbman_get_cmd(s, QBMAN_CENA_SWP_VDQCR); p = qbman_get_cmd(s, QBMAN_CENA_SWP_VDQCR);
p->numf = d->numf; p->numf = d->numf;
p->tok = QMAN_DQ_TOKEN_VALID; p->tok = QMAN_DQ_TOKEN_VALID;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment