[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1425561532.4288.34.camel@xylophone.i.decadent.org.uk>
Date: Thu, 05 Mar 2015 13:18:52 +0000
From: Ben Hutchings <ben.hutchings@...ethink.co.uk>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
linux-kernel@...ts.codethink.co.uk,
Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@...esas.com>,
Mitsuhiro Kimura <mitsuhiro.kimura.kc@...esas.com>,
Yoshihiro Kaneko <ykaneko0929@...il.com>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
Subject: Re: [net-next, 2/5] sh_eth: WARN on access to a register not
implemented in a particular chip
On Thu, 2015-03-05 at 10:02 +0100, Geert Uytterhoeven wrote:
> Replying to a patchwork mbox, as I noticed this is in net-next.
>
> On Thu, 26 Feb 2015, Ben Hutchings wrote:
> > Currently we may silently read/write a register at offset 0. Change
> > this to WARN and then ignore the write or read-back all-ones.
> >
> > Signed-off-by: Ben Hutchings <ben.hutchings@...ethink.co.uk>
> > Acked-by: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
>
> While this may be a good idea for debugging...
>
> > --- a/drivers/net/ethernet/renesas/sh_eth.h
> > +++ b/drivers/net/ethernet/renesas/sh_eth.h
> > @@ -543,19 +543,29 @@ static inline void sh_eth_soft_swap(char *src, int len)
> > #endif
> > }
> >
> > +#define SH_ETH_OFFSET_INVALID ((u16) ~0)
> > +
> > static inline void sh_eth_write(struct net_device *ndev, u32 data,
> > int enum_index)
> > {
> > struct sh_eth_private *mdp = netdev_priv(ndev);
> > + u16 offset = mdp->reg_offset[enum_index];
> > +
> > + if (WARN_ON(offset == SH_ETH_OFFSET_INVALID))
> > + return;
>
> ... adding WARN_ON() to static inline functions increases code size a lot:
>
> $ size drivers/net/ethernet/renesas/sh_eth.o{.orig,}
> text data bss dec hex filename
> 23352 1136 0 24488 5fa8 drivers/net/ethernet/renesas/sh_eth.o.orig
> 27225 1136 0 28361 6ec9 drivers/net/ethernet/renesas/sh_eth.o
> $
Time to un-inline it, maybe?
Ben.
--
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