* [Patch 1/2]r8169: remove rtl_rw_cpluscmd
@ 2010-06-03 11:24 Junchang Wang
2010-06-03 21:42 ` Francois Romieu
0 siblings, 1 reply; 3+ messages in thread
From: Junchang Wang @ 2010-06-03 11:24 UTC (permalink / raw)
To: romieu; +Cc: davem, netdev
Some clean up work. Please correct me if any of this is wrong.
Writting "cmd" back without modification is redundant.
Secondly, because rtl_rw_cpluscmd is just encapsulation of
RTL_R16, remove rtl_rw_cpluscmd.
Signed-off-by: Junchang Wang <junchangwang@gmail.com>
---
drivers/net/r8169.c | 13 ++-----------
1 files changed, 2 insertions(+), 11 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 217e709..6a37813 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -3404,15 +3404,6 @@ static void rtl_set_rx_tx_desc_registers(struct rtl8169_private *tp,
RTL_W32(RxDescAddrLow, ((u64) tp->RxPhyAddr) & DMA_BIT_MASK(32));
}
-static u16 rtl_rw_cpluscmd(void __iomem *ioaddr)
-{
- u16 cmd;
-
- cmd = RTL_R16(CPlusCmd);
- RTL_W16(CPlusCmd, cmd);
- return cmd;
-}
-
static void rtl_set_rx_max_size(void __iomem *ioaddr, unsigned int rx_buf_sz)
{
/* Low hurts. Let's disable the filtering. */
@@ -3471,7 +3462,7 @@ static void rtl_hw_start_8169(struct net_device *dev)
(tp->mac_version == RTL_GIGA_MAC_VER_04))
rtl_set_rx_tx_config_registers(tp);
- tp->cp_cmd |= rtl_rw_cpluscmd(ioaddr) | PCIMulRW;
+ tp->cp_cmd |= RTL_R16(CPlusCmd) | PCIMulRW;
if ((tp->mac_version == RTL_GIGA_MAC_VER_02) ||
(tp->mac_version == RTL_GIGA_MAC_VER_03)) {
@@ -3906,7 +3897,7 @@ static void rtl_hw_start_8101(struct net_device *dev)
rtl_set_rx_max_size(ioaddr, tp->rx_buf_sz);
- tp->cp_cmd |= rtl_rw_cpluscmd(ioaddr) | PCIMulRW;
+ tp->cp_cmd |= RTL_R16(CPlusCmd) | PCIMulRW;
RTL_W16(CPlusCmd, tp->cp_cmd);
--
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [Patch 1/2]r8169: remove rtl_rw_cpluscmd
2010-06-03 11:24 [Patch 1/2]r8169: remove rtl_rw_cpluscmd Junchang Wang
@ 2010-06-03 21:42 ` Francois Romieu
2010-06-04 1:37 ` Junchang Wang
0 siblings, 1 reply; 3+ messages in thread
From: Francois Romieu @ 2010-06-03 21:42 UTC (permalink / raw)
To: Junchang Wang; +Cc: davem, netdev
Junchang Wang <junchangwang@gmail.com> :
> Some clean up work. Please correct me if any of this is wrong.
>
> Writting "cmd" back without modification is redundant.
> Secondly, because rtl_rw_cpluscmd is just encapsulation of
> RTL_R16, remove rtl_rw_cpluscmd.
I'll figure that there may be some value in the patch if you
test the change on revision X, Y and Z.
Some cosmetic isolated in a sequence of changes can be fine too.
Otherwise I consider such cleanups as a (useless and) conceivably
harmful distraction.
--
Ueimor
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Patch 1/2]r8169: remove rtl_rw_cpluscmd
2010-06-03 21:42 ` Francois Romieu
@ 2010-06-04 1:37 ` Junchang Wang
0 siblings, 0 replies; 3+ messages in thread
From: Junchang Wang @ 2010-06-04 1:37 UTC (permalink / raw)
To: Francois Romieu; +Cc: davem, netdev
> I'll figure that there may be some value in the patch if you
> test the change on revision X, Y and Z.
Frankly, I just tested the patch on my NIC. It works fine.
>
> Some cosmetic isolated in a sequence of changes can be fine too.
>
> Otherwise I consider such cleanups as a (useless and) conceivably
> harmful distraction.
As I said, those points really confused me while I was going over the
driver. I searched google and mailing list archive but failed to get
any traces. It seems they exist for a long time without any touch
(care). So I decided to post the patches to see whether they are
harmful or not.
OK. I'll bypass legacy hardware-related codes since they are really
very tricky. :)
Thanks Francois.
--
--Junchang
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-06-04 1:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-03 11:24 [Patch 1/2]r8169: remove rtl_rw_cpluscmd Junchang Wang
2010-06-03 21:42 ` Francois Romieu
2010-06-04 1:37 ` Junchang Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox