* [PATCH v2 1/2] arm: virt_to_phys should take a volatile ptr
@ 2015-02-24 21:00 Lucas Stach
2015-02-24 21:00 ` [PATCH v2 2/2] net: rtl8169: silence compiler warning Lucas Stach
2015-02-25 7:37 ` [PATCH v2 1/2] arm: virt_to_phys should take a volatile ptr Sascha Hauer
0 siblings, 2 replies; 3+ messages in thread
From: Lucas Stach @ 2015-02-24 21:00 UTC (permalink / raw)
To: barebox
So users can pass in device memory pointers without provoking
warnings.
Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
arch/arm/cpu/mmu.c | 2 +-
arch/arm/include/asm/mmu.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c
index e733ec4..aaf66d4 100644
--- a/arch/arm/cpu/mmu.c
+++ b/arch/arm/cpu/mmu.c
@@ -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;
}
diff --git a/arch/arm/include/asm/mmu.h b/arch/arm/include/asm/mmu.h
index 4234979..c6e425f 100644
--- a/arch/arm/include/asm/mmu.h
+++ b/arch/arm/include/asm/mmu.h
@@ -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;
}
--
2.1.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2 2/2] net: rtl8169: silence compiler warning
2015-02-24 21:00 [PATCH v2 1/2] arm: virt_to_phys should take a volatile ptr Lucas Stach
@ 2015-02-24 21:00 ` Lucas Stach
2015-02-25 7:37 ` [PATCH v2 1/2] arm: virt_to_phys should take a volatile ptr Sascha Hauer
1 sibling, 0 replies; 3+ messages in thread
From: Lucas Stach @ 2015-02-24 21:00 UTC (permalink / raw)
To: barebox
Silence warning about cast from volatile to normal pointer,
as this is the intended bhavior here.
Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
drivers/net/rtl8169.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c
index 19f5763..f8a6500 100644
--- a/drivers/net/rtl8169.c
+++ b/drivers/net/rtl8169.c
@@ -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))
--
2.1.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2 1/2] arm: virt_to_phys should take a volatile ptr
2015-02-24 21:00 [PATCH v2 1/2] arm: virt_to_phys should take a volatile ptr Lucas Stach
2015-02-24 21:00 ` [PATCH v2 2/2] net: rtl8169: silence compiler warning Lucas Stach
@ 2015-02-25 7:37 ` Sascha Hauer
1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2015-02-25 7:37 UTC (permalink / raw)
To: Lucas Stach; +Cc: barebox
On Tue, Feb 24, 2015 at 10:00:18PM +0100, Lucas Stach wrote:
> So users can pass in device memory pointers without provoking
> warnings.
>
> Signed-off-by: Lucas Stach <dev@lynxeye.de>
> ---
> arch/arm/cpu/mmu.c | 2 +-
> arch/arm/include/asm/mmu.h | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
Applied, thanks
Sascha
--
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-02-25 7:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-24 21:00 [PATCH v2 1/2] arm: virt_to_phys should take a volatile ptr Lucas Stach
2015-02-24 21:00 ` [PATCH v2 2/2] net: rtl8169: silence compiler warning Lucas Stach
2015-02-25 7:37 ` [PATCH v2 1/2] arm: virt_to_phys should take a volatile ptr Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox