Skip to contentSkip to conversation

trivial cleanup

PATCH In review Amos Kong 2 participants 4 messages Jun 5, 2014

Subsystems (3)
lore
Share & tools
lore

Amos Kong

author
#0 lore raw

cover trivial cleanup

I found the RAM size in comments isn't correct,
fix it.

Amos Kong (2):
mvme147: fix ram size in comment
hplance: fix ram size in comment

 drivers/net/ethernet/amd/hplance.c | 4 ++--
 drivers/net/ethernet/amd/mvme147.c | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
Signature · 1 line
1.9.3
author
#1 lore raw

PATCH 1/2 mvme147: fix ram size in comment

The order of ram pages is 3, so the ram size is 2^3 * 4K = 32K.

---
 drivers/net/ethernet/amd/mvme147.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/amd/mvme147.c +3 -3
index 0e8399d..0660ac5 100644
@@ -26,9 +26,9 @@
 #include <asm/pgtable.h>
 #include <asm/mvme147hw.h>
 
-/* We have 16834 bytes of RAM for the init block and buffers. This places
+/* We have 32K of RAM for the init block and buffers. This places
  * an upper limit on the number of buffers we can use. NetBSD uses 8 Rx
- * buffers and 2 Tx buffers.
+ * buffers and 2 Tx buffers, it takes (8 + 2) * 1544 bytes.
  */
 #define LANCE_LOG_TX_BUFFERS 1
 #define LANCE_LOG_RX_BUFFERS 3
@@ -111,7 +111,7 @@ struct net_device * __init mvme147lance_probe(int unit)
 	       dev->dev_addr);
 
 	lp = netdev_priv(dev);
-	lp->ram = __get_dma_pages(GFP_ATOMIC, 3);	/* 16K */
+	lp->ram = __get_dma_pages(GFP_ATOMIC, 3);	/* 32K */
 	if (!lp->ram) {
 		printk("%s: No memory for LANCE buffers\n", dev->name);
 		free_netdev(dev);
Signature · 1 line
1.9.3
author
#2 lore raw

PATCH 2/2 hplance: fix ram size in comment

In reply to Amos Kong

drivers/net/ethernet/amd/hplance.h:
#define HPLANCE_MEMOFF 0x8000 /* struct lance_init_block */
#define HPLANCE_NVRAMOFF 0xC008 /* etheraddress as one *nibble* per byte */

The offset of RAM start is 0x8000, the offset of RAM end is 0xC008, so the RAM size is 16392 bytes.

---
 drivers/net/ethernet/amd/hplance.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/amd/hplance.c +2 -2
index 47ce57c..6c9de11 100644
@@ -27,9 +27,9 @@
 
 #include "hplance.h"
 
-/* We have 16834 bytes of RAM for the init block and buffers. This places
+/* We have 16392 bytes of RAM for the init block and buffers. This places
  * an upper limit on the number of buffers we can use. NetBSD uses 8 Rx
- * buffers and 2 Tx buffers.
+ * buffers and 2 Tx buffers, it takes (8 + 2) * 1544 bytes.
  */
 #define LANCE_LOG_TX_BUFFERS 1
 #define LANCE_LOG_RX_BUFFERS 3
Signature · 1 line
1.9.3