Source-Changes-HG archive

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

[src/trunk]: src/sys ifdef a variable like its use



details:   https://anonhg.NetBSD.org/src/rev/86ccaf0ec9df
branches:  trunk
changeset: 790050:86ccaf0ec9df
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Sep 15 14:47:40 2013 +0000

description:
ifdef a variable like its use

diffstat:

 sys/arch/sparc64/sparc64/trap.c |  12 ++++++++----
 sys/netinet/tcp_vtw.c           |   6 +++++-
 2 files changed, 13 insertions(+), 5 deletions(-)

diffs (69 lines):

diff -r b2b1bf8ffb33 -r 86ccaf0ec9df sys/arch/sparc64/sparc64/trap.c
--- a/sys/arch/sparc64/sparc64/trap.c   Sun Sep 15 14:45:50 2013 +0000
+++ b/sys/arch/sparc64/sparc64/trap.c   Sun Sep 15 14:47:40 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.178 2013/06/21 20:09:59 nakayama Exp $ */
+/*     $NetBSD: trap.c,v 1.179 2013/09/15 14:49:50 martin Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.178 2013/06/21 20:09:59 nakayama Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.179 2013/09/15 14:49:50 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -709,12 +709,16 @@
        case T_LDDF_ALIGN:
        case T_STDF_ALIGN:
                {
-               int64_t dsfsr, dsfar=0, isfsr;
-
+               int64_t dsfsr, dsfar=0;
+#ifdef DEBUG
+               int64_t isfsr;
+#endif
                dsfsr = ldxa(SFSR, ASI_DMMU);
                if (dsfsr & SFSR_FV)
                        dsfar = ldxa(SFAR, ASI_DMMU);
+#ifdef DEBUG
                isfsr = ldxa(SFSR, ASI_IMMU);
+#endif
                /* 
                 * If we're busy doing copyin/copyout continue
                 */
diff -r b2b1bf8ffb33 -r 86ccaf0ec9df sys/netinet/tcp_vtw.c
--- a/sys/netinet/tcp_vtw.c     Sun Sep 15 14:45:50 2013 +0000
+++ b/sys/netinet/tcp_vtw.c     Sun Sep 15 14:47:40 2013 +0000
@@ -124,7 +124,7 @@
 
 #include <netinet/tcp_vtw.h>
 
-__KERNEL_RCSID(0, "$NetBSD: tcp_vtw.c,v 1.9 2012/04/13 15:37:12 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_vtw.c,v 1.10 2013/09/15 14:47:40 martin Exp $");
 
 #define db_trace(__a, __b)     do { } while (/*CONSTCOND*/0)
 
@@ -1901,7 +1901,9 @@
 int
 vtw_add(int af, struct tcpcb *tp)
 {
+#ifdef VTW_DEBUG
        int             enable;
+#endif
        vtw_ctl_t       *ctl;
        vtw_t           *vtw;
 
@@ -1911,7 +1913,9 @@
        if (!ctl)
                return 0;
 
+#ifdef VTW_DEBUG
        enable = (af == AF_INET) ? tcp4_vtw_enable : tcp6_vtw_enable;
+#endif
 
        vtw = vtw_alloc(ctl);
 



Home | Main Index | Thread Index | Old Index