]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
staging: fsl-dpaa2/eth: Fix incorrect casts
authorIoana Radulescu <ruxandra.radulescu@nxp.com>
Mon, 26 Feb 2018 16:28:06 +0000 (10:28 -0600)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 14 Aug 2018 10:28:55 +0000 (12:28 +0200)
BugLink: http://bugs.launchpad.net/bugs/1783418
[ Upstream commit 75c583ab9709692a60871d4719006391cde8dc1d ]

The DPAA2 Ethernet 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: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c

index c8a8e3abfc3ac4cf9080906f3d0e2a467fefc150..d602b5f6ae2b87ed0ba4e6a859e8038569b5a8a9 100644 (file)
@@ -322,7 +322,7 @@ static int consume_frames(struct dpaa2_eth_channel *ch)
                }
 
                fd = dpaa2_dq_fd(dq);
-               fq = (struct dpaa2_eth_fq *)dpaa2_dq_fqd_ctx(dq);
+               fq = (struct dpaa2_eth_fq *)(uintptr_t)dpaa2_dq_fqd_ctx(dq);
                fq->stats.frames++;
 
                fq->consume(priv, ch, fd, &ch->napi);
@@ -1924,7 +1924,7 @@ static int setup_rx_flow(struct dpaa2_eth_priv *priv,
        queue.destination.id = fq->channel->dpcon_id;
        queue.destination.type = DPNI_DEST_DPCON;
        queue.destination.priority = 1;
-       queue.user_context = (u64)fq;
+       queue.user_context = (u64)(uintptr_t)fq;
        err = dpni_set_queue(priv->mc_io, 0, priv->mc_token,
                             DPNI_QUEUE_RX, 0, fq->flowid,
                             DPNI_QUEUE_OPT_USER_CTX | DPNI_QUEUE_OPT_DEST,
@@ -1976,7 +1976,7 @@ static int setup_tx_flow(struct dpaa2_eth_priv *priv,
        queue.destination.id = fq->channel->dpcon_id;
        queue.destination.type = DPNI_DEST_DPCON;
        queue.destination.priority = 0;
-       queue.user_context = (u64)fq;
+       queue.user_context = (u64)(uintptr_t)fq;
        err = dpni_set_queue(priv->mc_io, 0, priv->mc_token,
                             DPNI_QUEUE_TX_CONFIRM, 0, fq->flowid,
                             DPNI_QUEUE_OPT_USER_CTX | DPNI_QUEUE_OPT_DEST,