Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Fix build for USB_DEBUG without UMASS_DEBUG



details:   https://anonhg.NetBSD.org/src/rev/6888d3b6e3f0
branches:  trunk
changeset: 346237:6888d3b6e3f0
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sun Jul 03 07:27:37 2016 +0000

description:
Fix build for USB_DEBUG without UMASS_DEBUG

diffstat:

 sys/dev/usb/umass.c        |  10 ++++++----
 sys/dev/usb/umass_scsipi.c |   8 ++++----
 sys/dev/usb/umassvar.h     |  17 +++++++++--------
 3 files changed, 19 insertions(+), 16 deletions(-)

diffs (114 lines):

diff -r bc85a60dedb7 -r 6888d3b6e3f0 sys/dev/usb/umass.c
--- a/sys/dev/usb/umass.c       Sun Jul 03 07:24:56 2016 +0000
+++ b/sys/dev/usb/umass.c       Sun Jul 03 07:27:37 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umass.c,v 1.154 2016/07/03 07:24:56 skrll Exp $        */
+/*     $NetBSD: umass.c,v 1.155 2016/07/03 07:27:37 skrll Exp $        */
 
 /*
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -124,7 +124,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.154 2016/07/03 07:24:56 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.155 2016/07/03 07:27:37 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -158,6 +158,7 @@
 #include <dev/scsipi/scsipiconf.h>
 
 #ifdef USB_DEBUG
+#ifdef UMASS_DEBUG
 int umassdebug = 0;
 
 SYSCTL_SETUP(sysctl_hw_umass_setup, "sysctl hw.umass setup")
@@ -210,6 +211,7 @@
        NULL
 };
 #endif
+#endif
 
 /* USB device probe/attach/detach functions */
 int umass_match(device_t, cfdata_t, void *);
@@ -1614,8 +1616,8 @@
         * State handling for CBI transfers.
         */
 
-       DPRINTFM(UDMASS_CBI, "sc %p: Handling CBI state %d (%s), xfer=%p, ...",
-           sc, sc->transfer_state, states[sc->transfer_state], xfer);
+       DPRINTFM(UDMASS_CBI, "sc %p: Handling CBI state %d, xfer=%p, ...",
+           sc, sc->transfer_state, xfer, 0);
        DPRINTFM(UDMASS_CBI, "... err %d", err, 0, 0, 0);
 
        switch (sc->transfer_state) {
diff -r bc85a60dedb7 -r 6888d3b6e3f0 sys/dev/usb/umass_scsipi.c
--- a/sys/dev/usb/umass_scsipi.c        Sun Jul 03 07:24:56 2016 +0000
+++ b/sys/dev/usb/umass_scsipi.c        Sun Jul 03 07:27:37 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umass_scsipi.c,v 1.52 2016/07/01 12:16:35 skrll Exp $  */
+/*     $NetBSD: umass_scsipi.c,v 1.53 2016/07/03 07:27:37 skrll Exp $  */
 
 /*
  * Copyright (c) 2001, 2003, 2012 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umass_scsipi.c,v 1.52 2016/07/01 12:16:35 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass_scsipi.c,v 1.53 2016/07/03 07:27:37 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -403,10 +403,10 @@
        u_int delta;
        microtime(&tv);
        delta = (tv.tv_sec - sc->tv.tv_sec) * 1000000 + tv.tv_usec - sc->tv.tv_usec;
+       DPRINTFM(UDMASS_CMD, "delta=%u: xs=%p residue=%d status=%d", delta, xs,
+           residue, status);
 #endif
 
-       DPRINTFM(UDMASS_CMD, "delta=%u: xs=%p residue=%d status=%d", delta, xs,
-           residue, status);
 
        xs->resid = residue;
 
diff -r bc85a60dedb7 -r 6888d3b6e3f0 sys/dev/usb/umassvar.h
--- a/sys/dev/usb/umassvar.h    Sun Jul 03 07:24:56 2016 +0000
+++ b/sys/dev/usb/umassvar.h    Sun Jul 03 07:27:37 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umassvar.h,v 1.37 2016/07/01 12:16:35 skrll Exp $      */
+/*     $NetBSD: umassvar.h,v 1.38 2016/07/03 07:27:37 skrll Exp $      */
 
 /*-
  * Copyright (c) 1999 MAEKAWA Masahide <bishop%rr.iij4u.or.jp@localhost>,
@@ -29,6 +29,14 @@
  *     $FreeBSD: src/sys/dev/usb/umass.c,v 1.13 2000/03/26 01:39:12 n_hibma Exp $
  */
 
+#ifdef UMASS_DEBUG
+#define DIF(m, x)      if (umassdebug & (m)) do { x ; } while (0)
+extern int umassdebug;
+#else
+#define umassdebug     0
+#define DIF(m, x)      /* nop */
+#endif
+
 #define        DPRINTFM(M,FMT,A,B,C,D) USBHIST_LOGM(umassdebug,M,FMT,A,B,C,D)
 #define        UMASSHIST_FUNC()        USBHIST_FUNC()
 #define        UMASSHIST_CALLED(name)  USBHIST_CALLED(umassdebug)
@@ -46,13 +54,6 @@
 #define UDMASS_XFER    0x40000000      /* all transfers */
 #define UDMASS_CMD     0x80000000
 
-#ifdef UMASS_DEBUG
-#define DIF(m, x)      if (umassdebug & (m)) do { x ; } while (0)
-extern int umassdebug;
-#else
-#define DIF(m, x)      /* nop */
-#endif
-
 /* Generic definitions */
 
 #define UFI_COMMAND_LENGTH 12



Home | Main Index | Thread Index | Old Index