[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20081120.035919.07437424.davem@davemloft.net>
Date: Thu, 20 Nov 2008 03:59:19 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: buytenh@...tstofly.org
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH 2/6] mv643xx_eth: introduce per-port register area
pointer
From: Lennert Buytenhek <buytenh@...tstofly.org>
Date: Tue, 18 Nov 2008 23:29:01 +0100
> The mv643xx_eth driver uses the rdl()/wrl() macros to read and
> write hardware registers. Per-port registers are accessed in the
> following way:
>
> #define PORT_STATUS(p) (0x0444 + ((p) << 10))
>
> [...]
>
> static inline u32 rdl(struct mv643xx_eth_private *mp, int offset)
> {
> return readl(mp->shared->base + offset);
> }
>
> [...]
>
> port_status = rdl(mp, PORT_STATUS(mp->port_num));
>
> By giving the per-port 'struct mv643xx_eth_private' its own
> 'void __iomem *base' pointer that points to the per-port register
> area, we can get rid of both the double indirection and the << 10
> that is done for every per-port register access -- this patch does
> that.
>
> Signed-off-by: Lennert Buytenhek <buytenh@...vell.com>
Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists