Source-Changes-HG archive

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

[src/trunk]: src/sys Clean-up (remove redundant declarations, concentrate che...



details:   https://anonhg.NetBSD.org/src/rev/40d1d8501a33
branches:  trunk
changeset: 819647:40d1d8501a33
user:      flxd <flxd%NetBSD.org@localhost>
date:      Mon Dec 12 17:03:40 2016 +0000

description:
Clean-up (remove redundant declarations, concentrate checks).

diffstat:

 sys/arch/alpha/tc/tcasic.c |   5 ++---
 sys/arch/pmax/tc/tcbus.c   |   6 ++----
 sys/dev/tc/tc.c            |  25 +++++++++++++------------
 3 files changed, 17 insertions(+), 19 deletions(-)

diffs (106 lines):

diff -r 564461ff7eba -r 40d1d8501a33 sys/arch/alpha/tc/tcasic.c
--- a/sys/arch/alpha/tc/tcasic.c        Mon Dec 12 16:47:06 2016 +0000
+++ b/sys/arch/alpha/tc/tcasic.c        Mon Dec 12 17:03:40 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tcasic.c,v 1.44 2012/02/06 02:14:16 matt Exp $ */
+/* $NetBSD: tcasic.c,v 1.45 2016/12/12 17:03:40 flxd Exp $ */
 
 /*
  * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: tcasic.c,v 1.44 2012/02/06 02:14:16 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcasic.c,v 1.45 2016/12/12 17:03:40 flxd Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -179,7 +179,6 @@
 extern void    tfb_cnattach(tc_addr_t);
 extern void    px_cnattach(tc_addr_t);
 extern void    pxg_cnattach(tc_addr_t);
-extern int     tc_checkslot(tc_addr_t, char *);
 
 struct cnboards {
        const char      *cb_tcname;
diff -r 564461ff7eba -r 40d1d8501a33 sys/arch/pmax/tc/tcbus.c
--- a/sys/arch/pmax/tc/tcbus.c  Mon Dec 12 16:47:06 2016 +0000
+++ b/sys/arch/pmax/tc/tcbus.c  Mon Dec 12 17:03:40 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tcbus.c,v 1.31 2016/11/16 19:37:06 macallan Exp $      */
+/*     $NetBSD: tcbus.c,v 1.32 2016/12/12 17:03:41 flxd Exp $  */
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcbus.c,v 1.31 2016/11/16 19:37:06 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcbus.c,v 1.32 2016/12/12 17:03:41 flxd Exp $");
 
 #define        _PMAX_BUS_DMA_PRIVATE
 /*
@@ -179,8 +179,6 @@
 #include <pmax/pmax/cons.h>
 #include <pmax/dec_prom.h>
 
-int    tc_checkslot(tc_addr_t, char *);
-
 struct cnboards {
        const char      *cb_tcname;
        void    (*cb_cnattach)(tc_addr_t);
diff -r 564461ff7eba -r 40d1d8501a33 sys/dev/tc/tc.c
--- a/sys/dev/tc/tc.c   Mon Dec 12 16:47:06 2016 +0000
+++ b/sys/dev/tc/tc.c   Mon Dec 12 17:03:40 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tc.c,v 1.53 2016/07/19 18:27:27 christos Exp $ */
+/*     $NetBSD: tc.c,v 1.54 2016/12/12 17:03:41 flxd Exp $     */
 
 /*
  * Copyright (c) 1994, 1995 Carnegie-Mellon University.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tc.c,v 1.53 2016/07/19 18:27:27 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tc.c,v 1.54 2016/12/12 17:03:41 flxd Exp $");
 
 #include "opt_tcverbose.h"
 
@@ -209,6 +209,17 @@
 static int
 tc_check_romp(const struct tc_rommap *romp)
 {
+
+       switch (romp->tcr_width.v) {
+       case 1:
+       case 2:
+       case 4:
+               break;
+
+       default:
+               return 0;
+       }
+
        if (romp->tcr_stride.v != 4)
                return 0;
 
@@ -232,16 +243,6 @@
                romp = (struct tc_rommap *)
                    (slotbase + tc_slot_romoffs[i]);
 
-               switch (romp->tcr_width.v) {
-               case 1:
-               case 2:
-               case 4:
-                       break;
-
-               default:
-                       continue;
-               }
-
                if (!tc_check_romp(romp))
                        continue;
 



Home | Main Index | Thread Index | Old Index