netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] trivial cleanup
@ 2014-06-05  3:01 Amos Kong
  2014-06-05  3:01 ` [PATCH 1/2] mvme147: fix ram size in comment Amos Kong
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Amos Kong @ 2014-06-05  3:01 UTC (permalink / raw)
  To: linux-m68k; +Cc: geert, netdev, davem, schwab

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(-)

-- 
1.9.3

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] mvme147: fix ram size in comment
  2014-06-05  3:01 [PATCH 0/2] trivial cleanup Amos Kong
@ 2014-06-05  3:01 ` Amos Kong
  2014-06-05  3:01 ` [PATCH 2/2] hplance: " Amos Kong
  2014-06-05 22:14 ` [PATCH 0/2] trivial cleanup David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Amos Kong @ 2014-06-05  3:01 UTC (permalink / raw)
  To: linux-m68k; +Cc: geert, netdev, davem, schwab

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

Signed-off-by: Amos Kong <akong@redhat.com>
---
 drivers/net/ethernet/amd/mvme147.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/amd/mvme147.c b/drivers/net/ethernet/amd/mvme147.c
index 0e8399d..0660ac5 100644
--- a/drivers/net/ethernet/amd/mvme147.c
+++ b/drivers/net/ethernet/amd/mvme147.c
@@ -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);
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] hplance: fix ram size in comment
  2014-06-05  3:01 [PATCH 0/2] trivial cleanup Amos Kong
  2014-06-05  3:01 ` [PATCH 1/2] mvme147: fix ram size in comment Amos Kong
@ 2014-06-05  3:01 ` Amos Kong
  2014-06-05 22:14 ` [PATCH 0/2] trivial cleanup David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Amos Kong @ 2014-06-05  3:01 UTC (permalink / raw)
  To: linux-m68k; +Cc: geert, netdev, davem, schwab

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.

Signed-off-by: Amos Kong <akong@redhat.com>
---
 drivers/net/ethernet/amd/hplance.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/amd/hplance.c b/drivers/net/ethernet/amd/hplance.c
index 47ce57c..6c9de11 100644
--- a/drivers/net/ethernet/amd/hplance.c
+++ b/drivers/net/ethernet/amd/hplance.c
@@ -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
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] trivial cleanup
  2014-06-05  3:01 [PATCH 0/2] trivial cleanup Amos Kong
  2014-06-05  3:01 ` [PATCH 1/2] mvme147: fix ram size in comment Amos Kong
  2014-06-05  3:01 ` [PATCH 2/2] hplance: " Amos Kong
@ 2014-06-05 22:14 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2014-06-05 22:14 UTC (permalink / raw)
  To: akong; +Cc: linux-m68k, geert, netdev, schwab

From: Amos Kong <akong@redhat.com>
Date: Thu,  5 Jun 2014 11:01:20 +0800

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

Both patches applied, thank you.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-06-05 22:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-05  3:01 [PATCH 0/2] trivial cleanup Amos Kong
2014-06-05  3:01 ` [PATCH 1/2] mvme147: fix ram size in comment Amos Kong
2014-06-05  3:01 ` [PATCH 2/2] hplance: " Amos Kong
2014-06-05 22:14 ` [PATCH 0/2] trivial cleanup David Miller

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).