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 3/5] sh_eth: call sh_eth_tsu_get_offset() from TSU register accessors
Date: Mon, 23 Jul 2018 21:12:38 +0300 [thread overview]
Message-ID: <6a15eddc-a30d-a4e8-aa0d-05ee2091e32a@cogentembedded.com> (raw)
In-Reply-To: <24093fd0-1b9b-a211-f988-0272483185d6@cogentembedded.com>
With sh_eth_tsu_get_offset() now actually returning TSU register's offset,
we can at last use it in sh_eth_tsu_{read|write}(). Somehow this saves 248
bytes of object code with AArch64 gcc 4.8.5... :-)
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
drivers/net/ethernet/renesas/sh_eth.c | 4 ++--
1 file changed, 2 insertions(+), 2 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
@@ -447,7 +447,7 @@ static u16 sh_eth_tsu_get_offset(struct
static void sh_eth_tsu_write(struct sh_eth_private *mdp, u32 data,
int enum_index)
{
- u16 offset = mdp->reg_offset[enum_index];
+ u16 offset = sh_eth_tsu_get_offset(mdp, enum_index);
if (WARN_ON(offset == SH_ETH_OFFSET_INVALID))
return;
@@ -457,7 +457,7 @@ static void sh_eth_tsu_write(struct sh_e
static u32 sh_eth_tsu_read(struct sh_eth_private *mdp, int enum_index)
{
- u16 offset = mdp->reg_offset[enum_index];
+ u16 offset = sh_eth_tsu_get_offset(mdp, enum_index);
if (WARN_ON(offset == SH_ETH_OFFSET_INVALID))
return ~0U;
next prev parent reply other threads:[~2018-07-23 19:15 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 ` Sergei Shtylyov [this message]
2018-07-24 6:49 ` [PATCH 3/5] sh_eth: call sh_eth_tsu_get_offset() from TSU register accessors 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 ` [PATCH 5/5] sh_eth: make sh_eth_tsu_{read|write}_entry() prototypes symmetric Sergei Shtylyov
2018-07-24 6:52 ` 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=6a15eddc-a30d-a4e8-aa0d-05ee2091e32a@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox