Commit ecbecb0a authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by David S. Miller

sh_eth: call sh_eth_tsu_get_offset() from TSU register accessors

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: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 41414f0a
...@@ -447,7 +447,7 @@ static u16 sh_eth_tsu_get_offset(struct sh_eth_private *mdp, int enum_index) ...@@ -447,7 +447,7 @@ static u16 sh_eth_tsu_get_offset(struct sh_eth_private *mdp, int enum_index)
static void sh_eth_tsu_write(struct sh_eth_private *mdp, u32 data, static void sh_eth_tsu_write(struct sh_eth_private *mdp, u32 data,
int enum_index) 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)) if (WARN_ON(offset == SH_ETH_OFFSET_INVALID))
return; return;
...@@ -457,7 +457,7 @@ static void sh_eth_tsu_write(struct sh_eth_private *mdp, u32 data, ...@@ -457,7 +457,7 @@ static void sh_eth_tsu_write(struct sh_eth_private *mdp, u32 data,
static u32 sh_eth_tsu_read(struct sh_eth_private *mdp, int enum_index) 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)) if (WARN_ON(offset == SH_ETH_OFFSET_INVALID))
return ~0U; return ~0U;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment