Module Name: src
Committed By: tsutsui
Date: Wed Sep 2 10:43:25 UTC 2009
Modified Files:
src/sys/arch/sgimips/mace: if_mec.c
src/sys/dev/ic: dp83932.c
Log Message:
Invert logic around nested pmf(9) registrations for readability.
To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/sgimips/mace/if_mec.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/ic/dp83932.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/sgimips/mace/if_mec.c
diff -u src/sys/arch/sgimips/mace/if_mec.c:1.37 src/sys/arch/sgimips/mace/if_mec.c:1.38
--- src/sys/arch/sgimips/mace/if_mec.c:1.37 Tue Sep 1 17:10:42 2009
+++ src/sys/arch/sgimips/mace/if_mec.c Wed Sep 2 10:43:24 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: if_mec.c,v 1.37 2009/09/01 17:10:42 tsutsui Exp $ */
+/* $NetBSD: if_mec.c,v 1.38 2009/09/02 10:43:24 tsutsui Exp $ */
/*-
* Copyright (c) 2004, 2008 Izumi Tsutsui. All rights reserved.
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mec.c,v 1.37 2009/09/01 17:10:42 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mec.c,v 1.38 2009/09/02 10:43:24 tsutsui Exp $");
#include "opt_ddb.h"
#include "bpfilter.h"
@@ -726,10 +726,10 @@
#endif
/* set shutdown hook to reset interface on powerdown */
- if (!pmf_device_register1(self, NULL, NULL, mec_shutdown))
- aprint_error_dev(self, "couldn't establish power handler\n");
- else
+ if (pmf_device_register1(self, NULL, NULL, mec_shutdown))
pmf_class_network_register(self, &sc->sc_ethercom.ec_if);
+ else
+ aprint_error_dev(self, "couldn't establish power handler\n");
return;
Index: src/sys/dev/ic/dp83932.c
diff -u src/sys/dev/ic/dp83932.c:1.29 src/sys/dev/ic/dp83932.c:1.30
--- src/sys/dev/ic/dp83932.c:1.29 Tue Sep 1 17:12:42 2009
+++ src/sys/dev/ic/dp83932.c Wed Sep 2 10:43:25 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: dp83932.c,v 1.29 2009/09/01 17:12:42 tsutsui Exp $ */
+/* $NetBSD: dp83932.c,v 1.30 2009/09/02 10:43:25 tsutsui Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dp83932.c,v 1.29 2009/09/01 17:12:42 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dp83932.c,v 1.30 2009/09/02 10:43:25 tsutsui Exp $");
#include "bpfilter.h"
@@ -222,11 +222,11 @@
/*
* Make sure the interface is shutdown during reboot.
*/
- if (!pmf_device_register1(sc->sc_dev, NULL, NULL, sonic_shutdown))
+ if (pmf_device_register1(sc->sc_dev, NULL, NULL, sonic_shutdown))
+ pmf_class_network_register(sc->sc_dev, &sc->sc_ethercom.ec_if);
+ else
aprint_error_dev(sc->sc_dev,
"couldn't establish power handler\n");
- else
- pmf_class_network_register(sc->sc_dev, &sc->sc_ethercom.ec_if);
return;