From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>
Cc: linux-renesas-soc@vger.kernel.org
Subject: [PATCH 5/5] sh_eth: make sh_eth_tsu_{read|write}_entry() prototypes symmetric
Date: Mon, 23 Jul 2018 21:15:47 +0300 [thread overview]
Message-ID: <93618d2e-86b6-e467-b577-632a25cb2c4c@cogentembedded.com> (raw)
In-Reply-To: <24093fd0-1b9b-a211-f988-0272483185d6@cogentembedded.com>
sh_eth_tsu_read_entry() is still asymmetric with sh_eth_tsu_write_entry()
WRT their prototypes -- make them symmetric by passing to the former a TSU
register offset instead of its address and also adding the (now necessary)
'ndev' parameter...
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
drivers/net/ethernet/renesas/sh_eth.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
Index: net-next/drivers/net/ethernet/renesas/sh_eth.c
===================================================================
--- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c
+++ net-next/drivers/net/ethernet/renesas/sh_eth.c
@@ -2695,16 +2695,17 @@ static int sh_eth_tsu_write_entry(struct
return 0;
}
-static void sh_eth_tsu_read_entry(void *reg, u8 *addr)
+static void sh_eth_tsu_read_entry(struct net_device *ndev, u16 offset, u8 *addr)
{
+ struct sh_eth_private *mdp = netdev_priv(ndev);
u32 val;
- val = ioread32(reg);
+ val = ioread32(mdp->tsu_addr + offset);
addr[0] = (val >> 24) & 0xff;
addr[1] = (val >> 16) & 0xff;
addr[2] = (val >> 8) & 0xff;
addr[3] = val & 0xff;
- val = ioread32(reg + 4);
+ val = ioread32(mdp->tsu_addr + offset + 4);
addr[4] = (val >> 8) & 0xff;
addr[5] = val & 0xff;
}
@@ -2718,7 +2719,7 @@ static int sh_eth_tsu_find_entry(struct
u8 c_addr[ETH_ALEN];
for (i = 0; i < SH_ETH_TSU_CAM_ENTRIES; i++, reg_offset += 8) {
- sh_eth_tsu_read_entry(mdp->tsu_addr + reg_offset, c_addr);
+ sh_eth_tsu_read_entry(ndev, reg_offset, c_addr);
if (ether_addr_equal(addr, c_addr))
return i;
}
@@ -2839,7 +2840,7 @@ static void sh_eth_tsu_purge_mcast(struc
return;
for (i = 0; i < SH_ETH_TSU_CAM_ENTRIES; i++, reg_offset += 8) {
- sh_eth_tsu_read_entry(mdp->tsu_addr + reg_offset, addr);
+ sh_eth_tsu_read_entry(ndev, reg_offset, addr);
if (is_multicast_ether_addr(addr))
sh_eth_tsu_del_entry(ndev, addr);
}
next prev parent reply other threads:[~2018-07-23 19:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-23 18:08 [PATCH 0/5] sh_eth: clean up the TSU register accessors Sergei Shtylyov
2018-07-23 18:10 ` [PATCH 1/5] sh_eth: uninline sh_eth_tsu_get_offset() Sergei Shtylyov
2018-07-24 6:46 ` Geert Uytterhoeven
2018-07-23 18:11 ` [PATCH 2/5] sh_eth: make sh_eth_tsu_get_offset() match its name Sergei Shtylyov
2018-07-24 6:48 ` Geert Uytterhoeven
2018-07-23 18:12 ` [PATCH 3/5] sh_eth: call sh_eth_tsu_get_offset() from TSU register accessors Sergei Shtylyov
2018-07-24 6:49 ` Geert Uytterhoeven
2018-07-23 18:14 ` [PATCH 4/5] sh_eth: make sh_eth_tsu_write_entry() take 'offset' parameter Sergei Shtylyov
2018-07-24 6:50 ` Geert Uytterhoeven
2018-07-23 18:15 ` Sergei Shtylyov [this message]
2018-07-24 6:52 ` [PATCH 5/5] sh_eth: make sh_eth_tsu_{read|write}_entry() prototypes symmetric Geert Uytterhoeven
2018-07-23 19:35 ` [PATCH 0/5] sh_eth: clean up the TSU register accessors David Miller
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=93618d2e-86b6-e467-b577-632a25cb2c4c@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=davem@davemloft.net \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.