From: Anatolij Gustschin <agust@denx.de>
To: David Miller <davem@davemloft.net>
Cc: wd@denx.de, dzu@denx.de, netdev@vger.kernel.org,
linuxppc-dev@ozlabs.org, kosmo@semihalf.com
Subject: Re: [net-next-2.6 PATCH 2/3] fs_enet: Add support for MPC512x to fs_enet driver
Date: Thu, 21 Jan 2010 10:33:52 +0100 [thread overview]
Message-ID: <20100121103352.788a6f80@wker> (raw)
In-Reply-To: <20100121.012235.161201297.davem@davemloft.net>
On Thu, 21 Jan 2010 01:22:35 -0800 (PST)
David Miller <davem@davemloft.net> wrote:
> From: Anatolij Gustschin <agust@denx.de>
> Date: Thu, 21 Jan 2010 03:13:18 +0100
>
> > struct fec_info {
> > - fec_t __iomem *fecp;
> > + void __iomem *fecp;
> ...
> > /* write */
> > -#define FW(_fecp, _reg, _v) __fs_out32(&(_fecp)->fec_ ## _reg, (_v))
> > +#define FW(_regp, _reg, _v) __fs_out32((_regp)->fec_ ## _reg, (_v))
> ...
> > +/* register address macros */
> > +#define fec_reg_addr(_type, _reg) \
> > + (fep->fec.rtbl->fec_##_reg = (u32 __iomem *)((u32)fep->fec.fecp + \
> > + (u32)&((__typeof__(_type) *)NULL)->fec_##_reg))
> > +
> > +#define fec_reg_mpc8xx(_reg) \
> > + fec_reg_addr(struct mpc8xx_fec, _reg)
> > +
> > +#define fec_reg_mpc5121(_reg) \
> > + fec_reg_addr(struct mpc5121_fec, _reg)
>
> This is a step backwards in my view.
>
> If you use the "fec_t __iomem *" type for the register
> pointer, you simply use &p->fecp->XXX to get the I/O
> address of register XXX and that's what you pass to
> the appropriate I/O accessor routines.
>
> Now you've made it typeless, and then you have to walk
> through all of these contortions to get the offset.
OK, i give up
WARNING: multiple messages have this Message-ID (diff)
From: Anatolij Gustschin <agust@denx.de>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, dzu@denx.de, wd@denx.de,
jcrigby@gmail.com, kosmo@semihalf.com, linuxppc-dev@ozlabs.org,
grant.likely@secretlab.ca
Subject: Re: [net-next-2.6 PATCH 2/3] fs_enet: Add support for MPC512x to fs_enet driver
Date: Thu, 21 Jan 2010 10:33:52 +0100 [thread overview]
Message-ID: <20100121103352.788a6f80@wker> (raw)
In-Reply-To: <20100121.012235.161201297.davem@davemloft.net>
On Thu, 21 Jan 2010 01:22:35 -0800 (PST)
David Miller <davem@davemloft.net> wrote:
> From: Anatolij Gustschin <agust@denx.de>
> Date: Thu, 21 Jan 2010 03:13:18 +0100
>
> > struct fec_info {
> > - fec_t __iomem *fecp;
> > + void __iomem *fecp;
> ...
> > /* write */
> > -#define FW(_fecp, _reg, _v) __fs_out32(&(_fecp)->fec_ ## _reg, (_v))
> > +#define FW(_regp, _reg, _v) __fs_out32((_regp)->fec_ ## _reg, (_v))
> ...
> > +/* register address macros */
> > +#define fec_reg_addr(_type, _reg) \
> > + (fep->fec.rtbl->fec_##_reg = (u32 __iomem *)((u32)fep->fec.fecp + \
> > + (u32)&((__typeof__(_type) *)NULL)->fec_##_reg))
> > +
> > +#define fec_reg_mpc8xx(_reg) \
> > + fec_reg_addr(struct mpc8xx_fec, _reg)
> > +
> > +#define fec_reg_mpc5121(_reg) \
> > + fec_reg_addr(struct mpc5121_fec, _reg)
>
> This is a step backwards in my view.
>
> If you use the "fec_t __iomem *" type for the register
> pointer, you simply use &p->fecp->XXX to get the I/O
> address of register XXX and that's what you pass to
> the appropriate I/O accessor routines.
>
> Now you've made it typeless, and then you have to walk
> through all of these contortions to get the offset.
OK, i give up
next prev parent reply other threads:[~2010-01-21 9:34 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-21 2:13 [net-next-2.6 PATCH 0/3] Support for MPC512x FEC Anatolij Gustschin
2010-01-21 2:13 ` Anatolij Gustschin
2010-01-21 2:13 ` [net-next-2.6 PATCH 1/3] fs_enet: use dev_xxx instead of printk Anatolij Gustschin
2010-01-21 2:13 ` Anatolij Gustschin
2010-01-21 16:43 ` Grant Likely
2010-01-21 16:43 ` Grant Likely
2010-01-21 2:13 ` [net-next-2.6 PATCH 2/3] fs_enet: Add support for MPC512x to fs_enet driver Anatolij Gustschin
2010-01-21 2:13 ` Anatolij Gustschin
2010-01-21 9:22 ` David Miller
2010-01-21 9:22 ` David Miller
2010-01-21 9:33 ` Anatolij Gustschin [this message]
2010-01-21 9:33 ` Anatolij Gustschin
2010-01-21 15:25 ` Wolfgang Grandegger
2010-01-21 15:25 ` Wolfgang Grandegger
2010-01-22 2:03 ` David Miller
2010-01-22 2:03 ` David Miller
2010-01-22 9:35 ` Wolfgang Grandegger
2010-01-22 9:35 ` Wolfgang Grandegger
2010-02-09 14:23 ` Anatolij Gustschin
2010-02-09 14:23 ` Anatolij Gustschin
2010-02-09 20:13 ` David Miller
2010-02-09 20:13 ` David Miller
2010-02-10 9:15 ` Wolfgang Grandegger
2010-02-10 9:15 ` Wolfgang Grandegger
2010-02-10 10:20 ` Wolfgang Grandegger
2010-02-10 10:20 ` Wolfgang Grandegger
2010-02-10 14:28 ` Grant Likely
2010-02-10 14:28 ` Grant Likely
2010-01-23 9:23 ` Arnd Bergmann
2010-01-23 9:23 ` Arnd Bergmann
2010-01-24 14:40 ` Wolfgang Grandegger
2010-01-24 14:40 ` Wolfgang Grandegger
2010-01-24 16:41 ` Wolfgang Denk
2010-01-24 16:41 ` Wolfgang Denk
2010-01-27 2:06 ` Arnd Bergmann
2010-01-27 2:06 ` Arnd Bergmann
2010-01-27 8:13 ` Wolfgang Grandegger
2010-01-27 8:13 ` Wolfgang Grandegger
2010-01-21 20:15 ` Wolfgang Grandegger
2010-01-21 20:15 ` Wolfgang Grandegger
2010-01-21 2:13 ` [net-next-2.6 PATCH 3/3] fs_enet: Add FEC TX Alignment workaround for MPC5121 Anatolij Gustschin
2010-01-21 2:13 ` Anatolij Gustschin
2010-01-21 16:49 ` Grant Likely
2010-01-21 16:49 ` Grant Likely
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=20100121103352.788a6f80@wker \
--to=agust@denx.de \
--cc=davem@davemloft.net \
--cc=dzu@denx.de \
--cc=kosmo@semihalf.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=netdev@vger.kernel.org \
--cc=wd@denx.de \
/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.