Patchwork [U-Boot,03/24] e1000: fix compile warning

login
register
mail settings
Submitter Wolfgang Denk
Date Nov. 25, 2010, 4 p.m.
Message ID <1290700844-31427-4-git-send-email-wd@denx.de>
Download mbox | patch
Permalink /patch/73075/
State Accepted
Headers show

Comments

Wolfgang Denk - Nov. 25, 2010, 4 p.m.
Get rid of compiler warning:
e1000.c: In function 'e1000_transmit':
e1000.c:5028: warning: passing argument 1 of 'virt_to_phys' discards qualifiers from pointer target type

Signed-off-by: Wolfgang Denk <wd@denx.de>
---
 drivers/net/e1000.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Sergei Shtylyov - Nov. 28, 2010, 5:48 p.m.
Hello.

On 25-11-2010 19:00, Wolfgang Denk wrote:

> Get rid of compiler warning:
> e1000.c: In function 'e1000_transmit':
> e1000.c:5028: warning: passing argument 1 of 'virt_to_phys' discards qualifiers from pointer target type

> Signed-off-by: Wolfgang Denk<wd@denx.de>
[...]

> diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c
> index 60b04c2..5f390bd 100644
> --- a/drivers/net/e1000.c
> +++ b/drivers/net/e1000.c
> @@ -5018,6 +5018,7 @@ TRANSMIT - Transmit a frame
>   static int
>   e1000_transmit(struct eth_device *nic, volatile void *packet, int length)
>   {
> +	void * nv_packet = (void *)packet;

    I suspect checkpatch.pl would complain about the space following *...

WBR, Sergei

Patch

diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c
index 60b04c2..5f390bd 100644
--- a/drivers/net/e1000.c
+++ b/drivers/net/e1000.c
@@ -5018,6 +5018,7 @@  TRANSMIT - Transmit a frame
 static int
 e1000_transmit(struct eth_device *nic, volatile void *packet, int length)
 {
+	void * nv_packet = (void *)packet;
 	struct e1000_hw *hw = nic->priv;
 	struct e1000_tx_desc *txp;
 	int i = 0;
@@ -5025,7 +5026,7 @@  e1000_transmit(struct eth_device *nic, volatile void *packet, int length)
 	txp = tx_base + tx_tail;
 	tx_tail = (tx_tail + 1) % 8;
 
-	txp->buffer_addr = cpu_to_le64(virt_to_bus(hw->pdev, packet));
+	txp->buffer_addr = cpu_to_le64(virt_to_bus(hw->pdev, nv_packet));
 	txp->lower.data = cpu_to_le32(hw->txd_cmd | length);
 	txp->upper.data = 0;
 	E1000_WRITE_REG(hw, TDT, tx_tail);