Commit 6e4a76291ebd5c61dcaa8281cefe0bd2d883c1fd

Authored by Arnd Bergmann
Committed by David S. Miller
1 parent 65f6092517

caif: include linux/io.h

The caif_shmcore requires io.h in order to use ioremap, so include that
explicitly to compile in all configurations.

Also add a note about the use of ioremap(), which is not a proper way
to map a DMA buffer into kernel space. It's not completely clear what
the intention is for using ioremap, but it is clear that the result
of ioremap must not simply be accessed using kernel pointers but
should use readl/writel or memcopy_{to,from}io. Assigning the result
of ioremap to a regular pointer that can also be set to something
else is not ok.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 4 additions and 0 deletions Side-by-side Diff

drivers/net/caif/caif_shmcore.c
... ... @@ -13,6 +13,7 @@
13 13 #include <linux/list.h>
14 14 #include <linux/netdevice.h>
15 15 #include <linux/if_arp.h>
  16 +#include <linux/io.h>
16 17  
17 18 #include <net/caif/caif_device.h>
18 19 #include <net/caif/caif_shm.h>
... ... @@ -647,6 +648,9 @@
647 648 if (pshm_dev->shm_loopback)
648 649 tx_buf->desc_vptr = (unsigned char *)tx_buf->phy_addr;
649 650 else
  651 + /*
  652 + * FIXME: the result of ioremap is not a pointer - arnd
  653 + */
650 654 tx_buf->desc_vptr =
651 655 ioremap(tx_buf->phy_addr, TX_BUF_SZ);
652 656