summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasili Galka <vvv444@gmail.com>2014-08-26 13:46:17 +0300
committerTom Rini <trini@ti.com>2014-09-15 13:32:56 -0400
commit9f680d2d978a9ab488b210ceeb90354308a0b750 (patch)
treeff2f50b33b54b82f42079905f8b98f09990f3042
parent5d69a5d178a1fc3874b8d18e5be3e520f6acaca5 (diff)
openrisc: Fix a few type cast related warnings
Use size_t type for positive offsets instead of the loff_t type. The later is defined as long long, which is larger than the pointer type on OpenRISC architecture and therefore the following warning was generated: "warning: cast to pointer from integer of different size" Signed-off-by: Vasili Galka <vvv444@gmail.com>
-rw-r--r--drivers/net/ethoc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c
index af06d4fb82..46c82bbb40 100644
--- a/drivers/net/ethoc.c
+++ b/drivers/net/ethoc.c
@@ -189,12 +189,12 @@ struct ethoc_bd {
u32 addr;
};
-static inline u32 ethoc_read(struct eth_device *dev, loff_t offset)
+static inline u32 ethoc_read(struct eth_device *dev, size_t offset)
{
return readl(dev->iobase + offset);
}
-static inline void ethoc_write(struct eth_device *dev, loff_t offset, u32 data)
+static inline void ethoc_write(struct eth_device *dev, size_t offset, u32 data)
{
writel(data, dev->iobase + offset);
}
@@ -202,7 +202,7 @@ static inline void ethoc_write(struct eth_device *dev, loff_t offset, u32 data)
static inline void ethoc_read_bd(struct eth_device *dev, int index,
struct ethoc_bd *bd)
{
- loff_t offset = ETHOC_BD_BASE + (index * sizeof(struct ethoc_bd));
+ size_t offset = ETHOC_BD_BASE + (index * sizeof(struct ethoc_bd));
bd->stat = ethoc_read(dev, offset + 0);
bd->addr = ethoc_read(dev, offset + 4);
}
@@ -210,7 +210,7 @@ static inline void ethoc_read_bd(struct eth_device *dev, int index,
static inline void ethoc_write_bd(struct eth_device *dev, int index,
const struct ethoc_bd *bd)
{
- loff_t offset = ETHOC_BD_BASE + (index * sizeof(struct ethoc_bd));
+ size_t offset = ETHOC_BD_BASE + (index * sizeof(struct ethoc_bd));
ethoc_write(dev, offset + 0, bd->stat);
ethoc_write(dev, offset + 4, bd->addr);
}