From: Scott Wood <scottwood@freescale.com>
To: jgarzik@pobox.com
Cc: netdev@vger.kernel.org
Subject: [PATCH 4/9] fs_enet: mac-fcc: Eliminate __fcc-* macros.
Date: Mon, 1 Oct 2007 14:20:50 -0500 [thread overview]
Message-ID: <20071001192050.GC28429@loki.buserror.net> (raw)
In-Reply-To: <20071001192017.GA28410@loki.buserror.net>
These macros accomplish nothing other than defeating type checking.
This patch also fixes one instance of the wrong register size being
used that was revealed by enabling type checking.
Signed-off-by: Scott Wood <scottwood@freescale.com>
---
drivers/net/fs_enet/mac-fcc.c | 25 ++++++++-----------------
1 files changed, 8 insertions(+), 17 deletions(-)
diff --git a/drivers/net/fs_enet/mac-fcc.c b/drivers/net/fs_enet/mac-fcc.c
index 1e1024a..e990f72 100644
--- a/drivers/net/fs_enet/mac-fcc.c
+++ b/drivers/net/fs_enet/mac-fcc.c
@@ -48,28 +48,19 @@
/* FCC access macros */
-#define __fcc_out32(addr, x) out_be32((unsigned *)addr, x)
-#define __fcc_out16(addr, x) out_be16((unsigned short *)addr, x)
-#define __fcc_out8(addr, x) out_8((unsigned char *)addr, x)
-#define __fcc_in32(addr) in_be32((unsigned *)addr)
-#define __fcc_in16(addr) in_be16((unsigned short *)addr)
-#define __fcc_in8(addr) in_8((unsigned char *)addr)
-
-/* parameter space */
-
/* write, read, set bits, clear bits */
-#define W32(_p, _m, _v) __fcc_out32(&(_p)->_m, (_v))
-#define R32(_p, _m) __fcc_in32(&(_p)->_m)
+#define W32(_p, _m, _v) out_be32(&(_p)->_m, (_v))
+#define R32(_p, _m) in_be32(&(_p)->_m)
#define S32(_p, _m, _v) W32(_p, _m, R32(_p, _m) | (_v))
#define C32(_p, _m, _v) W32(_p, _m, R32(_p, _m) & ~(_v))
-#define W16(_p, _m, _v) __fcc_out16(&(_p)->_m, (_v))
-#define R16(_p, _m) __fcc_in16(&(_p)->_m)
+#define W16(_p, _m, _v) out_be16(&(_p)->_m, (_v))
+#define R16(_p, _m) in_be16(&(_p)->_m)
#define S16(_p, _m, _v) W16(_p, _m, R16(_p, _m) | (_v))
#define C16(_p, _m, _v) W16(_p, _m, R16(_p, _m) & ~(_v))
-#define W8(_p, _m, _v) __fcc_out8(&(_p)->_m, (_v))
-#define R8(_p, _m) __fcc_in8(&(_p)->_m)
+#define W8(_p, _m, _v) out_8(&(_p)->_m, (_v))
+#define R8(_p, _m) in_8(&(_p)->_m)
#define S8(_p, _m, _v) W8(_p, _m, R8(_p, _m) | (_v))
#define C8(_p, _m, _v) W8(_p, _m, R8(_p, _m) & ~(_v))
@@ -290,7 +281,7 @@ static void restart(struct net_device *dev)
/* clear everything (slow & steady does it) */
for (i = 0; i < sizeof(*ep); i++)
- __fcc_out8((char *)ep + i, 0);
+ out_8((char *)ep + i, 0);
/* get physical address */
rx_bd_base_phys = fep->ring_mem_addr;
@@ -495,7 +486,7 @@ static void tx_kickstart(struct net_device *dev)
struct fs_enet_private *fep = netdev_priv(dev);
fcc_t *fccp = fep->fcc.fccp;
- S32(fccp, fcc_ftodr, 0x80);
+ S16(fccp, fcc_ftodr, 0x8000);
}
static u32 get_int_events(struct net_device *dev)
--
1.5.3.2
next prev parent reply other threads:[~2007-10-01 19:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-01 19:20 [PATCH 1/9] fs_enet: Whitespace cleanup Scott Wood
2007-10-01 19:20 ` [PATCH 2/9] fs_enet: Fix build breakage Scott Wood
2007-10-01 19:20 ` [PATCH 3/9] fs_enet: Include linux/string.h from linux/fs_enet_pd.h Scott Wood
2007-10-01 19:20 ` Scott Wood [this message]
2007-10-01 19:20 ` [PATCH 5/9] fs_enet: Align receive buffers Scott Wood
2007-10-01 19:20 ` [PATCH 6/9] fs_enet: Be an of_platform device when CONFIG_PPC_CPM_NEW_BINDING is set Scott Wood
2007-10-01 19:20 ` [PATCH 7/9] Generic bitbanged MDIO library Scott Wood
2007-10-01 19:20 ` [PATCH 8/9] fs_enet: Convert mii-bitbang to use the generic bitbang MDIO code Scott Wood
2007-10-01 19:20 ` [PATCH 9/9] fs_enet: sparse fixes Scott Wood
2007-10-02 15:55 ` [PATCH v2 6/9] fs_enet: Be an of_platform device when CONFIG_PPC_CPM_NEW_BINDING is set Scott Wood
2007-10-02 17:31 ` [PATCH 1/9] fs_enet: Whitespace cleanup Jeff Garzik
-- strict thread matches above, loose matches on Subject: below --
2007-09-20 22:00 [PATCH 0/9] fs enet and mdio bitbang patches Scott Wood
2007-09-20 22:01 ` [PATCH 4/9] fs_enet: mac-fcc: Eliminate __fcc-* macros Scott Wood
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=20071001192050.GC28429@loki.buserror.net \
--to=scottwood@freescale.com \
--cc=jgarzik@pobox.com \
--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.