Wed Sep 2 17:22:53 2009 UTC ()
Use a proper local variable.


(tsutsui)
diff -r1.38 -r1.39 src/sys/arch/sgimips/mace/if_mec.c
diff -r1.31 -r1.32 src/sys/dev/ic/dp83932.c

cvs diff -r1.38 -r1.39 src/sys/arch/sgimips/mace/if_mec.c (expand / switch to unified diff)

--- src/sys/arch/sgimips/mace/if_mec.c 2009/09/02 10:43:24 1.38
+++ src/sys/arch/sgimips/mace/if_mec.c 2009/09/02 17:22:53 1.39
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_mec.c,v 1.38 2009/09/02 10:43:24 tsutsui Exp $ */ 1/* $NetBSD: if_mec.c,v 1.39 2009/09/02 17:22:53 tsutsui Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2004, 2008 Izumi Tsutsui. All rights reserved. 4 * Copyright (c) 2004, 2008 Izumi Tsutsui. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
@@ -51,27 +51,27 @@ @@ -51,27 +51,27 @@
51 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 51 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
52 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 52 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
53 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 53 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
54 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 54 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
55 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 55 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
56 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 56 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
57 */ 57 */
58 58
59/* 59/*
60 * MACE MAC-110 Ethernet driver 60 * MACE MAC-110 Ethernet driver
61 */ 61 */
62 62
63#include <sys/cdefs.h> 63#include <sys/cdefs.h>
64__KERNEL_RCSID(0, "$NetBSD: if_mec.c,v 1.38 2009/09/02 10:43:24 tsutsui Exp $"); 64__KERNEL_RCSID(0, "$NetBSD: if_mec.c,v 1.39 2009/09/02 17:22:53 tsutsui Exp $");
65 65
66#include "opt_ddb.h" 66#include "opt_ddb.h"
67#include "bpfilter.h" 67#include "bpfilter.h"
68#include "rnd.h" 68#include "rnd.h"
69 69
70#include <sys/param.h> 70#include <sys/param.h>
71#include <sys/systm.h> 71#include <sys/systm.h>
72#include <sys/device.h> 72#include <sys/device.h>
73#include <sys/callout.h> 73#include <sys/callout.h>
74#include <sys/mbuf.h> 74#include <sys/mbuf.h>
75#include <sys/malloc.h> 75#include <sys/malloc.h>
76#include <sys/kernel.h> 76#include <sys/kernel.h>
77#include <sys/socket.h> 77#include <sys/socket.h>
@@ -717,27 +717,27 @@ mec_attach(device_t parent, device_t sel @@ -717,27 +717,27 @@ mec_attach(device_t parent, device_t sel
717 NULL, device_xname(self), "TX pkts w/ptrs ~80bytes hdr"); 717 NULL, device_xname(self), "TX pkts w/ptrs ~80bytes hdr");
718 evcnt_attach_dynamic(&sc->sc_ev_txptrh5 , EVCNT_TYPE_MISC, 718 evcnt_attach_dynamic(&sc->sc_ev_txptrh5 , EVCNT_TYPE_MISC,
719 NULL, device_xname(self), "TX pkts w/ptrs ~96bytes hdr"); 719 NULL, device_xname(self), "TX pkts w/ptrs ~96bytes hdr");
720 evcnt_attach_dynamic(&sc->sc_ev_txdstall , EVCNT_TYPE_MISC, 720 evcnt_attach_dynamic(&sc->sc_ev_txdstall , EVCNT_TYPE_MISC,
721 NULL, device_xname(self), "TX stalled due to no txdesc"); 721 NULL, device_xname(self), "TX stalled due to no txdesc");
722 evcnt_attach_dynamic(&sc->sc_ev_txempty , EVCNT_TYPE_MISC, 722 evcnt_attach_dynamic(&sc->sc_ev_txempty , EVCNT_TYPE_MISC,
723 NULL, device_xname(self), "TX empty interrupts"); 723 NULL, device_xname(self), "TX empty interrupts");
724 evcnt_attach_dynamic(&sc->sc_ev_txsent , EVCNT_TYPE_MISC, 724 evcnt_attach_dynamic(&sc->sc_ev_txsent , EVCNT_TYPE_MISC,
725 NULL, device_xname(self), "TX sent interrupts"); 725 NULL, device_xname(self), "TX sent interrupts");
726#endif 726#endif
727 727
728 /* set shutdown hook to reset interface on powerdown */ 728 /* set shutdown hook to reset interface on powerdown */
729 if (pmf_device_register1(self, NULL, NULL, mec_shutdown)) 729 if (pmf_device_register1(self, NULL, NULL, mec_shutdown))
730 pmf_class_network_register(self, &sc->sc_ethercom.ec_if); 730 pmf_class_network_register(self, ifp);
731 else 731 else
732 aprint_error_dev(self, "couldn't establish power handler\n"); 732 aprint_error_dev(self, "couldn't establish power handler\n");
733 733
734 return; 734 return;
735 735
736 /* 736 /*
737 * Free any resources we've allocated during the failed attach 737 * Free any resources we've allocated during the failed attach
738 * attempt. Do this in reverse order and fall though. 738 * attempt. Do this in reverse order and fall though.
739 */ 739 */
740 fail_4: 740 fail_4:
741 for (i = 0; i < MEC_NTXDESC; i++) { 741 for (i = 0; i < MEC_NTXDESC; i++) {
742 if (sc->sc_txsoft[i].txs_dmamap != NULL) 742 if (sc->sc_txsoft[i].txs_dmamap != NULL)
743 bus_dmamap_destroy(sc->sc_dmat, 743 bus_dmamap_destroy(sc->sc_dmat,

cvs diff -r1.31 -r1.32 src/sys/dev/ic/dp83932.c (expand / switch to unified diff)

--- src/sys/dev/ic/dp83932.c 2009/09/02 14:58:38 1.31
+++ src/sys/dev/ic/dp83932.c 2009/09/02 17:22:53 1.32
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: dp83932.c,v 1.31 2009/09/02 14:58:38 tsutsui Exp $ */ 1/* $NetBSD: dp83932.c,v 1.32 2009/09/02 17:22:53 tsutsui Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2001 The NetBSD Foundation, Inc. 4 * Copyright (c) 2001 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe. 8 * by Jason R. Thorpe.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -25,27 +25,27 @@ @@ -25,27 +25,27 @@
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32/* 32/*
33 * Device driver for the National Semiconductor DP83932 33 * Device driver for the National Semiconductor DP83932
34 * Systems-Oriented Network Interface Controller (SONIC). 34 * Systems-Oriented Network Interface Controller (SONIC).
35 */ 35 */
36 36
37#include <sys/cdefs.h> 37#include <sys/cdefs.h>
38__KERNEL_RCSID(0, "$NetBSD: dp83932.c,v 1.31 2009/09/02 14:58:38 tsutsui Exp $"); 38__KERNEL_RCSID(0, "$NetBSD: dp83932.c,v 1.32 2009/09/02 17:22:53 tsutsui Exp $");
39 39
40#include "bpfilter.h" 40#include "bpfilter.h"
41 41
42#include <sys/param.h> 42#include <sys/param.h>
43#include <sys/systm.h> 43#include <sys/systm.h>
44#include <sys/mbuf.h> 44#include <sys/mbuf.h>
45#include <sys/malloc.h> 45#include <sys/malloc.h>
46#include <sys/kernel.h> 46#include <sys/kernel.h>
47#include <sys/socket.h> 47#include <sys/socket.h>
48#include <sys/ioctl.h> 48#include <sys/ioctl.h>
49#include <sys/errno.h> 49#include <sys/errno.h>
50#include <sys/device.h> 50#include <sys/device.h>
51 51
@@ -213,27 +213,27 @@ sonic_attach(struct sonic_softc *sc, con @@ -213,27 +213,27 @@ sonic_attach(struct sonic_softc *sc, con
213 */ 213 */
214 sc->sc_ethercom.ec_capabilities |= ETHERCAP_VLAN_MTU; 214 sc->sc_ethercom.ec_capabilities |= ETHERCAP_VLAN_MTU;
215 215
216 /* 216 /*
217 * Attach the interface. 217 * Attach the interface.
218 */ 218 */
219 if_attach(ifp); 219 if_attach(ifp);
220 ether_ifattach(ifp, enaddr); 220 ether_ifattach(ifp, enaddr);
221 221
222 /* 222 /*
223 * Make sure the interface is shutdown during reboot. 223 * Make sure the interface is shutdown during reboot.
224 */ 224 */
225 if (pmf_device_register1(sc->sc_dev, NULL, NULL, sonic_shutdown)) 225 if (pmf_device_register1(sc->sc_dev, NULL, NULL, sonic_shutdown))
226 pmf_class_network_register(sc->sc_dev, &sc->sc_ethercom.ec_if); 226 pmf_class_network_register(sc->sc_dev, ifp);
227 else 227 else
228 aprint_error_dev(sc->sc_dev, 228 aprint_error_dev(sc->sc_dev,
229 "couldn't establish power handler\n"); 229 "couldn't establish power handler\n");
230 230
231 return; 231 return;
232 232
233 /* 233 /*
234 * Free any resources we've allocated during the failed attach 234 * Free any resources we've allocated during the failed attach
235 * attempt. Do this in reverse order and fall through. 235 * attempt. Do this in reverse order and fall through.
236 */ 236 */
237 fail_6: 237 fail_6:
238 bus_dmamap_destroy(sc->sc_dmat, sc->sc_nulldmamap); 238 bus_dmamap_destroy(sc->sc_dmat, sc->sc_nulldmamap);
239 fail_5: 239 fail_5: