Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arc - remove unused variables



details:   https://anonhg.NetBSD.org/src/rev/236173bb0513
branches:  trunk
changeset: 325280:236173bb0513
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon Dec 16 15:46:57 2013 +0000

description:
- remove unused variables
- use (void) when we don't care about the return value
- move variables inside their usage #if

diffstat:

 sys/arch/arc/arc/c_magnum.c   |   7 +++----
 sys/arch/arc/arc/c_nec_jazz.c |   7 +++----
 sys/arch/arc/arc/machdep.c    |  13 ++++++++-----
 sys/arch/arc/jazz/fd.c        |   8 ++------
 4 files changed, 16 insertions(+), 19 deletions(-)

diffs (132 lines):

diff -r a806b27d972e -r 236173bb0513 sys/arch/arc/arc/c_magnum.c
--- a/sys/arch/arc/arc/c_magnum.c       Mon Dec 16 15:45:29 2013 +0000
+++ b/sys/arch/arc/arc/c_magnum.c       Mon Dec 16 15:46:57 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: c_magnum.c,v 1.22 2011/07/01 19:28:00 dyoung Exp $     */
+/*     $NetBSD: c_magnum.c,v 1.23 2013/12/16 15:46:57 mrg Exp $        */
 /*     $OpenBSD: machdep.c,v 1.36 1999/05/22 21:22:19 weingart Exp $   */
 
 /*
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: c_magnum.c,v 1.22 2011/07/01 19:28:00 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: c_magnum.c,v 1.23 2013/12/16 15:46:57 mrg Exp $");
 
 #define __INTR_PRIVATE
 #include <sys/param.h>
@@ -105,9 +105,8 @@
 uint32_t
 timer_magnum_intr(uint32_t mask, struct clockframe *cf)
 {
-       int temp;
 
-       temp = inw(R4030_SYS_IT_STAT);
+       (void)inw(R4030_SYS_IT_STAT);
        last_cp0_count = mips3_cp0_count_read();
        hardclock(cf);
        timer_jazzio_ev.ev_count++;
diff -r a806b27d972e -r 236173bb0513 sys/arch/arc/arc/c_nec_jazz.c
--- a/sys/arch/arc/arc/c_nec_jazz.c     Mon Dec 16 15:45:29 2013 +0000
+++ b/sys/arch/arc/arc/c_nec_jazz.c     Mon Dec 16 15:46:57 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: c_nec_jazz.c,v 1.13 2008/03/14 16:43:27 tsutsui Exp $  */
+/*     $NetBSD: c_nec_jazz.c,v 1.14 2013/12/16 15:46:57 mrg Exp $      */
 
 /*-
  * Copyright (C) 2000 Shuichiro URATA.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: c_nec_jazz.c,v 1.13 2008/03/14 16:43:27 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: c_nec_jazz.c,v 1.14 2013/12/16 15:46:57 mrg Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -65,9 +65,8 @@
 uint32_t
 timer_nec_jazz_intr(uint32_t mask, struct clockframe *cf)
 {
-       int temp;
 
-       temp = in32(RD94_SYS_INTSTAT3);
+       (void)in32(RD94_SYS_INTSTAT3);
        last_cp0_count = mips3_cp0_count_read();
        hardclock(cf);
        timer_jazzio_ev.ev_count++;
diff -r a806b27d972e -r 236173bb0513 sys/arch/arc/arc/machdep.c
--- a/sys/arch/arc/arc/machdep.c        Mon Dec 16 15:45:29 2013 +0000
+++ b/sys/arch/arc/arc/machdep.c        Mon Dec 16 15:46:57 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.126 2012/07/28 23:08:56 matt Exp $       */
+/*     $NetBSD: machdep.c,v 1.127 2013/12/16 15:46:57 mrg Exp $        */
 /*     $OpenBSD: machdep.c,v 1.36 1999/05/22 21:22:19 weingart Exp $   */
 
 /*
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.126 2012/07/28 23:08:56 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.127 2013/12/16 15:46:57 mrg Exp $");
 
 #include "opt_ddb.h"
 #include "opt_ddbparam.h"
@@ -172,7 +172,10 @@
 {
        const char *cp;
        int i;
-       paddr_t kernstartpfn, kernendpfn, first, last;
+#if 0
+       paddr_t kernstartpfn;
+#endif
+       paddr_t first, last, kernendpfn;
        char *kernend;
 #if NKSYMS > 0 || defined(DDB) || defined(MODULAR)
        char *ssym = NULL;
@@ -367,10 +370,10 @@
        /*
         * Load the rest of the pages into the VM system.
         */
+       kernendpfn = atop(round_page(MIPS_KSEG0_TO_PHYS(kernend)));
+#if 0
        kernstartpfn = atop(trunc_page(
            MIPS_KSEG0_TO_PHYS((kernel_text) - UPAGES * PAGE_SIZE)));
-       kernendpfn = atop(round_page(MIPS_KSEG0_TO_PHYS(kernend)));
-#if 0
        /* give all free memory to VM */
        /* XXX - currently doesn't work, due to "panic: pmap_enter: pmap" */
        for (i = 0; i < mem_cluster_cnt; i++) {
diff -r a806b27d972e -r 236173bb0513 sys/arch/arc/jazz/fd.c
--- a/sys/arch/arc/jazz/fd.c    Mon Dec 16 15:45:29 2013 +0000
+++ b/sys/arch/arc/jazz/fd.c    Mon Dec 16 15:46:57 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fd.c,v 1.41 2011/07/01 19:25:41 dyoung Exp $   */
+/*     $NetBSD: fd.c,v 1.42 2013/12/16 15:46:57 mrg Exp $      */
 /*     $OpenBSD: fd.c,v 1.6 1998/10/03 21:18:57 millert Exp $  */
 /*     NetBSD: fd.c,v 1.78 1995/07/04 07:23:09 mycroft Exp     */
 
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.41 2011/07/01 19:25:41 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.42 2013/12/16 15:46:57 mrg Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -245,12 +245,8 @@
 fdcattach(struct fdc_softc *fdc)
 {
        struct fdc_attach_args fa;
-       bus_space_tag_t iot;
-       bus_space_handle_t ioh;
        int type;
 
-       iot = fdc->sc_iot;
-       ioh = fdc->sc_ioh;
        callout_init(&fdc->sc_timo_ch, 0);
        callout_init(&fdc->sc_intr_ch, 0);
 



Home | Main Index | Thread Index | Old Index