netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Manish_Lachwani@pmc-sierra.com
Cc: netdev@oss.sgi.com
Subject: [PATCH] small MV643xx fixes
Date: Tue, 24 Aug 2004 23:40:35 +0200	[thread overview]
Message-ID: <20040824214035.GA27932@lst.de> (raw)

 - kill an unused variable in mv64340_eth_remove
 - kill pointer arithmetics on integers sillyness
 - don't include <asm/addrspace.h> - it's unessecary and mips-specific



--- 1.6/drivers/net/mv643xx_eth.c	2004-07-14 20:59:24 +02:00
+++ edited/drivers/net/mv643xx_eth.c	2004-08-24 14:00:58 +02:00
@@ -1403,8 +1403,6 @@
 
 static void mv64340_eth_remove(struct net_device *dev)
 {
-	struct mv64340_private *mp = netdev_priv(dev);
-
 	unregister_netdev(dev);
 	flush_scheduled_work();
 	free_netdev(dev);
@@ -1739,12 +1737,12 @@
 	/* Assignment of Tx CTRP of given queue */
 	tx_curr_desc = mp->tx_curr_desc_q;
 	MV_WRITE(MV64340_ETH_TX_CURRENT_QUEUE_DESC_PTR_0(eth_port_num),
-	         (struct eth_tx_desc *) mp->tx_desc_dma + tx_curr_desc);
+		 mp->tx_desc_dma + tx_curr_desc * sizeof(struct eth_tx_desc));
 
 	/* Assignment of Rx CRDP of given queue */
 	rx_curr_desc = mp->rx_curr_desc_q;
 	MV_WRITE(MV64340_ETH_RX_CURRENT_QUEUE_DESC_PTR_0(eth_port_num),
-		 (struct eth_rx_desc *) mp->rx_desc_dma + rx_curr_desc);
+		 mp->rx_desc_dma + rx_curr_desc * sizeof(struct eth_rx_desc));
 
 	/* Add the assigned Ethernet address to the port's address table */
 	eth_port_uc_addr_set(mp->port_num, mp->port_mac_addr);
@@ -2355,8 +2353,10 @@
 		first_chip_ptr = MV_READ(MV64340_ETH_CURRENT_SERVED_TX_DESC_PTR(mp->port_num));
 
 		/* Apply send command */
-		if (first_chip_ptr == 0x00000000)
-			MV_WRITE(MV64340_ETH_TX_CURRENT_QUEUE_DESC_PTR_0(mp->port_num), (struct eth_tx_desc *) mp->tx_desc_dma + tx_first_desc);
+		if (first_chip_ptr == 0x00000000) {
+			MV_WRITE(MV64340_ETH_TX_CURRENT_QUEUE_DESC_PTR_0(mp->port_num),
+				 mp->tx_desc_dma + tx_first_desc * sizeof(struct eth_tx_desc));
+		}
 
                 ETH_ENABLE_TX_QUEUE(mp->port_num);
 
--- 1.6/include/linux/mv643xx.h	2004-07-27 19:45:06 +02:00
+++ edited/include/linux/mv643xx.h	2004-08-24 13:42:29 +02:00
@@ -13,7 +13,6 @@
 #ifndef __ASM_MV64340_H
 #define __ASM_MV64340_H
 
-#include <asm/addrspace.h>
 #include <asm/marvell.h>
 
 /****************************************/
 

                 reply	other threads:[~2004-08-24 21:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040824214035.GA27932@lst.de \
    --to=hch@lst.de \
    --cc=Manish_Lachwani@pmc-sierra.com \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).