arm: virt_to_phys should take a volatile ptr
Subsystems (2)
PATCH v2 1/2 arm: virt_to_phys should take a volatile ptr
So users can pass in device memory pointers without provoking warnings.
Signed-off-by Lucas Stach <[email protected]>
--- arch/arm/cpu/mmu.c | 2 +- arch/arm/include/asm/mmu.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/cpu/mmu.c +1 -1
@@ -393,7 +393,7 @@ void *dma_alloc_coherent(size_t size)return ret; } -unsigned long virt_to_phys (void *virt) +unsigned long virt_to_phys (volatile void *virt) {return (unsigned long )virt; }
arch/arm/include/asm/mmu.h +2 -2
@@ -39,7 +39,7 @@ void dma_free_coherent(void *mem, size_t size);void dma_clean_range (unsigned long ,unsigned long );void dma_flush_range (unsigned long ,unsigned long );void dma_inv_range (unsigned long ,unsigned long ); -unsigned long virt_to_phys (void *virt); +unsigned long virt_to_phys (volatile void *virt);void *phys_to_virt (unsigned long phys);void remap_range (void *_start,size_t size,uint32_t flags);void *map_io_sections (unsigned long physaddr,void *start,size_t size);
@@ -62,7 +62,7 @@ static inline void *phys_to_virt(unsigned long phys)return (void *)phys; } -static inline unsigned long virt_to_phys (void *mem) +static inline unsigned long virt_to_phys (volatile void *mem) {return (unsigned long )mem; }
Signature · 7 lines
2.1.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v2 2/2 net: rtl8169: silence compiler warning
Silence warning about cast from volatile to normal pointer, as this is the intended bhavior here.
Signed-off-by Lucas Stach <[email protected]>
--- drivers/net/rtl8169.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/rtl8169.c +2 -2
@@ -236,8 +236,8 @@ static void rtl8169_init_ring(struct rtl8169_priv *priv)dma_clean_range ((unsigned long )priv->rx_buf, (unsigned long )priv->rx_buf +NUM_RX_DESC *PKT_BUF_SIZE ); -memset (priv->tx_desc,0 ,NUM_TX_DESC *sizeof (struct bufdesc )); -memset (priv->rx_desc,0 ,NUM_RX_DESC *sizeof (struct bufdesc )); +memset ((void *)priv->tx_desc,0 ,NUM_TX_DESC *sizeof (struct bufdesc )); +memset ((void *)priv->rx_desc,0 ,NUM_RX_DESC *sizeof (struct bufdesc ));for (i =0 ; i <NUM_RX_DESC ; i++) {if (i == (NUM_RX_DESC -1 ))
Signature · 7 lines
2.1.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
AppliedQuoted 8 lines · Lucas Stach
So users can pass in device memory pointers without provoking warnings.
Signed-off-by Lucas Stach <[email protected]>--- arch/arm/cpu/mmu.c | 2 +- arch/arm/include/asm/mmu.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
Applied, thanks
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox