Module Name:    src
Committed By:   christos
Date:           Mon Mar 24 18:50:31 UTC 2014

Modified Files:
        src/sys/arch/sun2/dev: if_ie_obio.c
        src/sys/arch/sun2/sun2: machdep.c pmap.c promlib.c

Log Message:
- remove unused
- use cpu_{g,s}etmodel


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/sun2/dev/if_ie_obio.c
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/sun2/sun2/machdep.c
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/sun2/sun2/pmap.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/sun2/sun2/promlib.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/sun2/dev/if_ie_obio.c
diff -u src/sys/arch/sun2/dev/if_ie_obio.c:1.15 src/sys/arch/sun2/dev/if_ie_obio.c:1.16
--- src/sys/arch/sun2/dev/if_ie_obio.c:1.15	Fri Jun  3 12:28:40 2011
+++ src/sys/arch/sun2/dev/if_ie_obio.c	Mon Mar 24 14:50:31 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ie_obio.c,v 1.15 2011/06/03 16:28:40 tsutsui Exp $	*/
+/*	$NetBSD: if_ie_obio.c,v 1.16 2014/03/24 18:50:31 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ie_obio.c,v 1.15 2011/06/03 16:28:40 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ie_obio.c,v 1.16 2014/03/24 18:50:31 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -260,7 +260,6 @@ ie_obio_attach(device_t parent, device_t
 	int rseg;
 	int error;
 	paddr_t pa;
-	struct intrhand *ih;
 	bus_size_t memsize;
 	u_long iebase;
 	uint8_t myaddr[ETHER_ADDR_LEN];
@@ -393,6 +392,6 @@ ie_obio_attach(device_t parent, device_t
 	i82586_attach(sc, "onboard", myaddr, media, NMEDIA, media[0]);
 
 	/* Establish interrupt channel */
-	ih = bus_intr_establish(oba->oba_bustag, oba->oba_pri, IPL_NET, 0,
-				i82586_intr, sc);
+	bus_intr_establish(oba->oba_bustag, oba->oba_pri, IPL_NET, 0,
+	    i82586_intr, sc);
 }

Index: src/sys/arch/sun2/sun2/machdep.c
diff -u src/sys/arch/sun2/sun2/machdep.c:1.76 src/sys/arch/sun2/sun2/machdep.c:1.77
--- src/sys/arch/sun2/sun2/machdep.c:1.76	Fri Aug 10 10:52:26 2012
+++ src/sys/arch/sun2/sun2/machdep.c	Mon Mar 24 14:50:31 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.76 2012/08/10 14:52:26 tsutsui Exp $	*/
+/*	$NetBSD: machdep.c,v 1.77 2014/03/24 18:50:31 christos Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -149,7 +149,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.76 2012/08/10 14:52:26 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.77 2014/03/24 18:50:31 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -179,6 +179,7 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 
 #include <sys/vnode.h>
 #include <sys/syscallargs.h>
 #include <sys/ksyms.h>
+#include <sys/cpu.h>
 #ifdef	KGDB
 #include <sys/kgdb.h>
 #endif
@@ -366,7 +367,6 @@ cpu_startup(void)
  */
 char	machine[16] = MACHINE;		/* from <machine/param.h> */
 char	kernel_arch[16] = "sun2";	/* XXX needs a sysctl node */
-char	cpu_model[120];
 
 /*
  * Determine which Sun2 model we are running on.
@@ -378,9 +378,9 @@ identifycpu(void)
 
 	/* Other stuff? (VAC, mc6888x version, etc.) */
 	/* Note: miniroot cares about the kernel_arch part. */
-	sprintf(cpu_model, "%s %s", kernel_arch, cpu_string);
+	cpu_setmodel("%s %s", kernel_arch, cpu_string);
 
-	printf("Model: %s\n", cpu_model);
+	printf("Model: %s\n", cpu_getmodel());
 }
 
 /*
@@ -879,7 +879,7 @@ _bus_dmamap_load(bus_dma_tag_t t, bus_dm
 	int pagesz = PAGE_SIZE;
 	bus_addr_t dva;
 	pmap_t pmap;
-	int rv;
+	int rv __diagused;
 
 	/*
 	 * Make sure that on error condition we return "no valid mappings".

Index: src/sys/arch/sun2/sun2/pmap.c
diff -u src/sys/arch/sun2/sun2/pmap.c:1.46 src/sys/arch/sun2/sun2/pmap.c:1.47
--- src/sys/arch/sun2/sun2/pmap.c:1.46	Mon Jan  7 11:58:09 2013
+++ src/sys/arch/sun2/sun2/pmap.c	Mon Mar 24 14:50:31 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.46 2013/01/07 16:58:09 chs Exp $	*/
+/*	$NetBSD: pmap.c,v 1.47 2014/03/24 18:50:31 christos Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.46 2013/01/07 16:58:09 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.47 2014/03/24 18:50:31 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pmap_debug.h"
@@ -1324,15 +1324,12 @@ pv_link(pmap_t pmap, int pte, vaddr_t va
 	paddr_t pa;
 	pv_entry_t *head, pv;
 	u_char *pv_flags;
-	int flags;
 
 	if (!pv_initialized)
 		return 0;
 
 	CHECK_SPL();
 
-	/* Only the non-cached bit is of interest here. */
-	flags = (pte & PG_NC) ? PV_NC : 0;
 	pa = PG_PA(pte);
 
 #ifdef PMAP_DEBUG
@@ -1357,6 +1354,8 @@ pv_link(pmap_t pmap, int pte, vaddr_t va
 	/*
 	 * Does this new mapping cause VAC alias problems?
 	 */
+	/* Only the non-cached bit is of interest here. */
+	int flags = (pte & PG_NC) ? PV_NC : 0;
 
 	*pv_flags |= flags;
 	if ((*pv_flags & PV_NC) == 0) {
@@ -3070,9 +3069,8 @@ out:
 void 
 pmap_protect_mmu(pmap_t pmap, vaddr_t sva, vaddr_t eva)
 {
-	pmeg_t pmegp;
-	vaddr_t pgva, segva;
-	int pte, sme;
+	vaddr_t pgva, segva __diagused;
+	int pte;
 #ifdef	HAVECACHE
 	int flush_by_page = 0;
 #endif
@@ -3085,9 +3083,9 @@ pmap_protect_mmu(pmap_t pmap, vaddr_t sv
 #endif
 
 	segva = sun2_trunc_seg(sva);
-	sme = get_segmap(segva);
 
 #ifdef	DIAGNOSTIC
+	int sme = get_segmap(segva);
 	/* Make sure it is valid and known. */
 	if (sme == SEGINV)
 		panic("pmap_protect_mmu: SEGINV");
@@ -3095,10 +3093,10 @@ pmap_protect_mmu(pmap_t pmap, vaddr_t sv
 		panic("pmap_protect_mmu: incorrect sme, va=0x%lx", segva);
 #endif
 
-	pmegp = pmeg_p(sme);
-	/* have pmeg, will travel */
 
 #ifdef	DIAGNOSTIC
+	/* have pmeg, will travel */
+	pmeg_t pmegp = pmeg_p(sme);
 	/* Make sure we own the pmeg, right va, etc. */
 	if ((pmegp->pmeg_va != segva) ||
 	    (pmegp->pmeg_owner != pmap) ||

Index: src/sys/arch/sun2/sun2/promlib.c
diff -u src/sys/arch/sun2/sun2/promlib.c:1.17 src/sys/arch/sun2/sun2/promlib.c:1.18
--- src/sys/arch/sun2/sun2/promlib.c:1.17	Sun Jul 17 16:54:48 2011
+++ src/sys/arch/sun2/sun2/promlib.c	Mon Mar 24 14:50:31 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: promlib.c,v 1.17 2011/07/17 20:54:48 joerg Exp $	*/
+/*	$NetBSD: promlib.c,v 1.18 2014/03/24 18:50:31 christos Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: promlib.c,v 1.17 2011/07/17 20:54:48 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: promlib.c,v 1.18 2014/03/24 18:50:31 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -152,6 +152,7 @@ type new proto								\
 	int rc;								\
 	_mode_monitor(&state, 0);					\
 	rc = (*(romVectorPtr->old)) args;				\
+	__USE(rc);							\
 	_mode_kernel(&state, 0);					\
 	ret ;								\
 }
@@ -221,6 +222,7 @@ prom_printf(const char *fmt, ...)
 	    /* the PROM printf vector: */
 		(romVectorPtr->printf))
 		)(fmt, varargs);
+	__USE(rc);
 	_mode_kernel(&state, 0);
 }
 

Reply via email to