Module Name:    src
Committed By:   flxd
Date:           Mon Dec 12 17:03:41 UTC 2016

Modified Files:
        src/sys/arch/alpha/tc: tcasic.c
        src/sys/arch/pmax/tc: tcbus.c
        src/sys/dev/tc: tc.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/alpha/tc/tcasic.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/pmax/tc/tcbus.c
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/tc/tc.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/alpha/tc/tcasic.c
diff -u src/sys/arch/alpha/tc/tcasic.c:1.44 src/sys/arch/alpha/tc/tcasic.c:1.45
--- src/sys/arch/alpha/tc/tcasic.c:1.44	Mon Feb  6 02:14:16 2012
+++ src/sys/arch/alpha/tc/tcasic.c	Mon Dec 12 17:03:40 2016
@@ -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	mfb_cnattach(tc_addr_t);
 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;

Index: src/sys/arch/pmax/tc/tcbus.c
diff -u src/sys/arch/pmax/tc/tcbus.c:1.31 src/sys/arch/pmax/tc/tcbus.c:1.32
--- src/sys/arch/pmax/tc/tcbus.c:1.31	Wed Nov 16 19:37:06 2016
+++ src/sys/arch/pmax/tc/tcbus.c	Mon Dec 12 17:03:41 2016
@@ -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 @@ tc_ds_get_dma_tag(int slot)
 #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);

Index: src/sys/dev/tc/tc.c
diff -u src/sys/dev/tc/tc.c:1.53 src/sys/dev/tc/tc.c:1.54
--- src/sys/dev/tc/tc.c:1.53	Tue Jul 19 18:27:27 2016
+++ src/sys/dev/tc/tc.c	Mon Dec 12 17:03:41 2016
@@ -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 const tc_offset_t tc_slot_romoffs
 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 @@ tc_checkslot(tc_addr_t slotbase, char *n
 		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;
 

Reply via email to