On Fri, May 16, 2014 at 02:16:10PM -0400, Jean-Philippe Ouellet wrote:
> There are a bunch of nearby printfs which start with ": ..." without
> a devname. I'm not sure which one is preferred, so here's both ways.
> 
> 
> Index: ehci_cardbus.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/cardbus/ehci_cardbus.c,v
> retrieving revision 1.17
> diff -u -p -r1.17 ehci_cardbus.c
> --- ehci_cardbus.c    15 Apr 2013 09:23:00 -0000      1.17
> +++ ehci_cardbus.c    16 May 2014 17:47:18 -0000
> @@ -130,7 +130,7 @@ ehci_cardbus_attach(struct device *paren
>  
>       /* Disable interrupts, so we don't get any spurious ones. */
>       sc->sc.sc_offs = EREAD1(&sc->sc, EHCI_CAPLENGTH);
> -     DPRINTF((": offs=%d", devname, sc->sc.sc_offs));
> +     DPRINTF(("%s: offs=%d", devname, sc->sc.sc_offs));
>       EOWRITE2(&sc->sc, EHCI_USBINTR, 0);
>  
>       sc->sc_ih = cardbus_intr_establish(cc, cf, ca->ca_intrline,
> 
> 
> Index: ehci_cardbus.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/cardbus/ehci_cardbus.c,v
> retrieving revision 1.17
> diff -u -p -r1.17 ehci_cardbus.c
> --- ehci_cardbus.c    15 Apr 2013 09:23:00 -0000      1.17
> +++ ehci_cardbus.c    16 May 2014 18:05:38 -0000
> @@ -130,7 +130,7 @@ ehci_cardbus_attach(struct device *paren
>  
>       /* Disable interrupts, so we don't get any spurious ones. */
>       sc->sc.sc_offs = EREAD1(&sc->sc, EHCI_CAPLENGTH);
> -     DPRINTF((": offs=%d", devname, sc->sc.sc_offs));
> +     DPRINTF((": offs=%d", sc->sc.sc_offs));
>       EOWRITE2(&sc->sc, EHCI_USBINTR, 0);
>  
>       sc->sc_ih = cardbus_intr_establish(cc, cf, ca->ca_intrline,

mpi@ and myself came up with this some days ago, but then I forgot
about committing it.

Index: ehci_cardbus.c
===================================================================
RCS file: /cvs/src/sys/dev/cardbus/ehci_cardbus.c,v
retrieving revision 1.17
diff -u -p -r1.17 ehci_cardbus.c
--- ehci_cardbus.c      15 Apr 2013 09:23:00 -0000      1.17
+++ ehci_cardbus.c      11 May 2014 21:53:02 -0000
@@ -51,14 +51,6 @@
 #include <dev/usb/ehcireg.h>
 #include <dev/usb/ehcivar.h>
 
-#ifdef EHCI_DEBUG
-#define DPRINTF(x)     if (ehcidebug) printf x
-extern int ehcidebug;
-#else
-#define DPRINTF(x)
-#endif
-
-
 int    ehci_cardbus_match(struct device *, void *, void *);
 void   ehci_cardbus_attach(struct device *, struct device *, void *);
 int    ehci_cardbus_detach(struct device *, int);
@@ -130,7 +122,6 @@ ehci_cardbus_attach(struct device *paren
 
        /* Disable interrupts, so we don't get any spurious ones. */
        sc->sc.sc_offs = EREAD1(&sc->sc, EHCI_CAPLENGTH);
-       DPRINTF((": offs=%d", devname, sc->sc.sc_offs));
        EOWRITE2(&sc->sc, EHCI_USBINTR, 0);
 
        sc->sc_ih = cardbus_intr_establish(cc, cf, ca->ca_intrline,

Reply via email to