linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev@vger.kernel.org
Cc: "Florian Fainelli" <f.fainelli@gmail.com>,
	"Grygorii Strashko" <grygorii.strashko@ti.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Ivan Khoronzhuk" <ivan.khoronzhuk@linaro.org>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	Keerthy <j-keerthy@ti.com>, "Bhumika Goyal" <bhumirks@gmail.com>,
	"Hernán Gonzalez" <hernan@vanguardiasur.com.ar>,
	"Richard Cochran" <richardcochran@gmail.com>,
	"Lukas Wunner" <lukas@wunner.de>, "Rob Herring" <robh@kernel.org>,
	"open list:TI ETHERNET SWITCH DRIVER CPSW"
	<linux-omap@vger.kernel.org>,
	"open list" <linux-kernel@vger.kernel.org>
Subject: [PATCH net-next 5/5] ti: ethernet: davinci: Fix cast to int warnings
Date: Mon, 21 May 2018 11:45:55 -0700	[thread overview]
Message-ID: <20180521184555.21555-6-f.fainelli@gmail.com> (raw)
In-Reply-To: <20180521184555.21555-1-f.fainelli@gmail.com>

Now that we can compile test this driver on 64-bit hosts, we get some
warnings about how a pointer/address is written/read to/from a register
(sw_token). Fix this by doing the appropriate conversions, we cannot
possibly have the driver work on 64-bit hosts the way the tokens are
managed though, since the registers being written to a 32-bit only.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/ethernet/ti/davinci_cpdma.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/ti/davinci_cpdma.c b/drivers/net/ethernet/ti/davinci_cpdma.c
index 9ec49213de5e..cdbddf16dd29 100644
--- a/drivers/net/ethernet/ti/davinci_cpdma.c
+++ b/drivers/net/ethernet/ti/davinci_cpdma.c
@@ -1080,7 +1080,7 @@ int cpdma_chan_submit(struct cpdma_chan *chan, void *token, void *data,
 	writel_relaxed(buffer, &desc->hw_buffer);
 	writel_relaxed(len, &desc->hw_len);
 	writel_relaxed(mode | len, &desc->hw_mode);
-	writel_relaxed(token, &desc->sw_token);
+	writel_relaxed((uintptr_t)token, &desc->sw_token);
 	writel_relaxed(buffer, &desc->sw_buffer);
 	writel_relaxed(len, &desc->sw_len);
 	desc_read(desc, sw_len);
@@ -1121,15 +1121,15 @@ static void __cpdma_chan_free(struct cpdma_chan *chan,
 	struct cpdma_desc_pool		*pool = ctlr->pool;
 	dma_addr_t			buff_dma;
 	int				origlen;
-	void				*token;
+	uintptr_t			token;
 
-	token      = (void *)desc_read(desc, sw_token);
+	token      = desc_read(desc, sw_token);
 	buff_dma   = desc_read(desc, sw_buffer);
 	origlen    = desc_read(desc, sw_len);
 
 	dma_unmap_single(ctlr->dev, buff_dma, origlen, chan->dir);
 	cpdma_desc_free(pool, desc, 1);
-	(*chan->handler)(token, outlen, status);
+	(*chan->handler)((void *)token, outlen, status);
 }
 
 static int __cpdma_chan_process(struct cpdma_chan *chan)
-- 
2.14.1

  parent reply	other threads:[~2018-05-21 18:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-21 18:45 [PATCH net-next 0/5] TI Ethernet driver warnings fixes Florian Fainelli
2018-05-21 18:45 ` [PATCH net-next 1/5] ti: ethernet: cpdma: Use correct format for genpool_* Florian Fainelli
2018-05-21 18:45 ` [PATCH net-next 2/5] net: ethernet: ti: cpts: Fix timestamp print Florian Fainelli
2018-05-21 18:45 ` [PATCH net-next 3/5] net: ethernet: ti: cpsw: Fix cpsw_add_ch_strings() printk format Florian Fainelli
2018-05-21 18:45 ` [PATCH net-next 4/5] net: ethernet: davinci_emac: Fix printing of base address Florian Fainelli
2018-05-21 18:45 ` Florian Fainelli [this message]
2018-05-21 20:18 ` [PATCH net-next 0/5] TI Ethernet driver warnings fixes David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180521184555.21555-6-f.fainelli@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhumirks@gmail.com \
    --cc=davem@davemloft.net \
    --cc=grygorii.strashko@ti.com \
    --cc=hernan@vanguardiasur.com.ar \
    --cc=ivan.khoronzhuk@linaro.org \
    --cc=j-keerthy@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).