Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/fa72e98cf91f
branches:  trunk
changeset: 790708:fa72e98cf91f
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Oct 19 18:39:30 2013 +0000

description:
Ifdef a variable like its use

diffstat:

 sys/net/if.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (40 lines):

diff -r 76019bc68e9c -r fa72e98cf91f sys/net/if.c
--- a/sys/net/if.c      Sat Oct 19 17:45:00 2013 +0000
+++ b/sys/net/if.c      Sat Oct 19 18:39:30 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.c,v 1.267 2013/10/06 01:21:24 christos Exp $        */
+/*     $NetBSD: if.c,v 1.268 2013/10/19 18:39:30 martin Exp $  */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.267 2013/10/06 01:21:24 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.268 2013/10/19 18:39:30 martin Exp $");
 
 #include "opt_inet.h"
 
@@ -1323,7 +1323,10 @@
 void
 if_link_state_change(struct ifnet *ifp, int link_state)
 {
-       int old_link_state, s;
+       int s;
+#ifdef DEBUG
+       int old_link_state;
+#endif
 
        s = splnet();
        if (ifp->if_link_state == link_state) {
@@ -1331,7 +1334,9 @@
                return;
        }
 
+#ifdef DEBUG
        old_link_state = ifp->if_link_state;
+#endif
        ifp->if_link_state = link_state;
 #ifdef DEBUG
        log(LOG_DEBUG, "%s: link state %s (was %s)\n", ifp->if_xname,



Home | Main Index | Thread Index | Old Index