On Mon, Feb 15, 2010 at 10:51:32PM +0100, Wolfgang Grandegger wrote: > Ira Snyder wrote: > > On Mon, 15 Feb 2010 09:54:22 +0100 > > Kurt Van Dijck <[email protected]> wrote: > > > >> On Fri, Feb 12, 2010 at 03:50:53PM -0800, Ira W. Snyder wrote: > >>> The Janz ICAN3 is a MODULbus daughterboard which fits on the Janz CMOD-IO > >>> PCI carrier board. It is an intelligent CAN controller, with a > >>> microcontroller and associated firmware. > >>> > >>> Signed-off-by: Ira W. Snyder <[email protected]> > >>> --- > >>> > >> [...] > >>> +/* Maximum number of buffers on a CMOD-IO carrier board */ > >>> +#define JANZ_MAX_MODULES 4 > >>> + > >>> +struct janz_device { > >>> + struct device *dev; > >>> + struct pci_dev *pdev; > >> is dev == &pdev->dev? > > > > Yep. Convenience for printing stuff, so we have: > > dev_dbg(priv->dev, "msg\n"); > > > > Instead of: > > dev_dbg(&priv->pdev->dev, "msg\n"); > > > > It really helps on lines that are close to the 80 character limit. If > > you're worried about speed, the PCI accesses are going to hurt much > > more than a pointer dereference. > > What does hurt is the extra space for the variable. You can always declare: > > struct device *dev = &priv->pdev->dev; or even : #define DEV(x) (&priv->pdev->dev)
and dev_dbg(DEV(priv), ....) > > at the beginning of the functions if you use it often or want to shorten > lines. This costs nothing as the compiler will optimze anyhow. > > Wolfgang. > _______________________________________________ Socketcan-core mailing list [email protected] https://lists.berlios.de/mailman/listinfo/socketcan-core
