Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pcmcia Eliminate bogus initializer.



details:   https://anonhg.NetBSD.org/src/rev/82c304417dd4
branches:  trunk
changeset: 554494:82c304417dd4
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Tue Oct 28 23:16:50 2003 +0000

description:
Eliminate bogus initializer.

diffstat:

 sys/dev/pcmcia/if_ne_pcmcia.c |  23 +++++++++++------------
 sys/dev/pcmcia/if_ray.c       |  14 +++++++-------
 2 files changed, 18 insertions(+), 19 deletions(-)

diffs (110 lines):

diff -r d9e0811f5bb6 -r 82c304417dd4 sys/dev/pcmcia/if_ne_pcmcia.c
--- a/sys/dev/pcmcia/if_ne_pcmcia.c     Tue Oct 28 23:10:02 2003 +0000
+++ b/sys/dev/pcmcia/if_ne_pcmcia.c     Tue Oct 28 23:16:50 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ne_pcmcia.c,v 1.105 2003/10/25 18:29:40 christos Exp $      */
+/*     $NetBSD: if_ne_pcmcia.c,v 1.106 2003/10/28 23:16:50 mycroft Exp $       */
 
 /*
  * Copyright (c) 1997 Marc Horowitz.  All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ne_pcmcia.c,v 1.105 2003/10/25 18:29:40 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ne_pcmcia.c,v 1.106 2003/10/28 23:16:50 mycroft Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -623,7 +623,7 @@
        struct dp8390_softc *dsc = &nsc->sc_dp8390;
        struct pcmcia_attach_args *pa = aux;
        struct pcmcia_config_entry *cfe;
-       const struct ne2000dev *ne_dev = NULL;
+       const struct ne2000dev *ne_dev;
        int i;
        u_int8_t myea[6], *enaddr;
        const char *typestr = "";
@@ -748,18 +748,17 @@
                                if (enaddr == NULL)
                                        continue;
                        }
-                       break;
+                       goto found;
                }
        }
-       if (i == NE2000_NDEVS) {
-               printf("%s (manf %08x prod %08x) cis %s %s: "
-                      "can't match ethernet vendor code\n",
-                      dsc->sc_dev.dv_xname,
-                      pa->manufacturer, pa->product,
-                      pa->card->cis1_info[0], pa->card->cis1_info[1]);
-               goto fail_5;
-       }
+       printf("%s (manf %08x prod %08x) cis %s %s: "
+              "can't match ethernet vendor code\n",
+              dsc->sc_dev.dv_xname,
+              pa->manufacturer, pa->product,
+              pa->card->cis1_info[0], pa->card->cis1_info[1]);
+       goto fail_5;
 
+found:
        if ((ne_dev->flags & NE2000DVF_DL10019) != 0) {
                u_int8_t type;
 
diff -r d9e0811f5bb6 -r 82c304417dd4 sys/dev/pcmcia/if_ray.c
--- a/sys/dev/pcmcia/if_ray.c   Tue Oct 28 23:10:02 2003 +0000
+++ b/sys/dev/pcmcia/if_ray.c   Tue Oct 28 23:16:50 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ray.c,v 1.42 2003/10/27 07:07:34 chs Exp $  */
+/*     $NetBSD: if_ray.c,v 1.43 2003/10/28 23:24:07 mycroft Exp $      */
 /* 
  * Copyright (c) 2000 Christian E. Hopps
  * All rights reserved.
@@ -56,7 +56,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ray.c,v 1.42 2003/10/27 07:07:34 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ray.c,v 1.43 2003/10/28 23:24:07 mycroft Exp $");
 
 #include "opt_inet.h"
 #include "bpfilter.h"
@@ -1138,7 +1138,7 @@
 {
        struct ieee80211_frame *iframe;
        struct ether_header *eh;
-       size_t len, pktlen = 0, tmplen;
+       size_t len, pktlen, tmplen;
        bus_size_t bufp, ebufp;
        struct mbuf *m0, *m;
        struct ifnet *ifp;
@@ -1230,7 +1230,7 @@
                        tmplen = sizeof(struct ieee80211_frame);
                } else if (et > ETHERMTU) {
                        /* adjust for LLC/SNAP header */
-                       tmplen= sizeof(struct ieee80211_frame) - ETHER_ADDR_LEN;
+                       tmplen = sizeof(struct ieee80211_frame) - ETHER_ADDR_LEN;
                } else {
                        tmplen = 0;
                }
@@ -1325,6 +1325,9 @@
 #endif
                pcount++;
                m_freem(m0);
+
+               RAY_DPRINTF_XMIT(("%s: sent packet: len %ld\n", sc->sc_xname,
+                   (u_long)pktlen));
        }
 
        if (firsti == RAY_CCS_LINK_NULL)
@@ -1348,9 +1351,6 @@
        SRAM_WRITE_1(sc, RAY_SCB_CCSI, firsti);
        RAY_ECF_START_CMD(sc);
 
-       RAY_DPRINTF_XMIT(("%s: sent packet: len %ld\n", sc->sc_xname,
-           (u_long)pktlen));
-
        ifp->if_opackets += pcount;
 }
 



Home | Main Index | Thread Index | Old Index