Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/mips/mips KNF cleanup.



details:   https://anonhg.NetBSD.org/src/rev/0b3df7881514
branches:  trunk
changeset: 764654:0b3df7881514
user:      matt <matt%NetBSD.org@localhost>
date:      Fri Apr 29 22:14:35 2011 +0000

description:
KNF cleanup.

diffstat:

 sys/arch/mips/mips/db_interface.c |  26 ++++++++++++--------------
 1 files changed, 12 insertions(+), 14 deletions(-)

diffs (78 lines):

diff -r 9e81444b3cd7 -r 0b3df7881514 sys/arch/mips/mips/db_interface.c
--- a/sys/arch/mips/mips/db_interface.c Fri Apr 29 22:13:49 2011 +0000
+++ b/sys/arch/mips/mips/db_interface.c Fri Apr 29 22:14:35 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_interface.c,v 1.73 2011/04/14 17:43:07 matt Exp $   */
+/*     $NetBSD: db_interface.c,v 1.74 2011/04/29 22:14:35 matt Exp $   */
 
 /*
  * Mach Operating System
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.73 2011/04/14 17:43:07 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.74 2011/04/29 22:14:35 matt Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_cputype.h"       /* which mips CPUs do we support? */
@@ -47,8 +47,8 @@
 #include <mips/asm.h>
 #include <mips/regnum.h>
 #include <mips/cache.h>
+#include <mips/pcb.h>
 #include <mips/pte.h>
-#include <mips/cpu.h>
 #include <mips/locore.h>
 #include <mips/mips_opcode.h>
 #include <dev/cons.h>
@@ -521,7 +521,7 @@
        if (!have_addr) {
                db_printf("%-3s %-5s %-16s %4s %4s\n",
                        "#", "MODE", "ADDR", "MASK", "ASID");
-               for (int i=0; i < ci->ci_cpuwatch_count; i++) {
+               for (u_int i=0; i < ci->ci_cpuwatch_count; i++) {
                        cwp = &ci->ci_cpuwatch_tab[i];
                        mode = cwp->cw_mode;
                        if ((mode & CPUWATCH_RWX) == 0)
@@ -532,9 +532,9 @@
                        str[3] = (mode & CPUWATCH_MASK)  ?  'm' : '-';
                        str[4] = (mode & CPUWATCH_ASID)  ?  'a' : 'g';
                        str[5] = '\0';
-                       db_printf("%2d: %s %16" PRIxREGISTER
-                                 " %4" PRIxREGISTER " %4x\n",
-                                 i, str, cwp->cw_addr, cwp->cw_mask, cwp->cw_asid);
+                       db_printf("%2u: %s %16" PRIxREGISTER
+                           " %4" PRIxREGISTER " %4x\n",
+                           i, str, cwp->cw_addr, cwp->cw_mask, cwp->cw_asid);
                }
                db_flush_lex();
                return;
@@ -629,13 +629,12 @@
                 const char *modif)
 {
        struct cpu_info * const ci = curcpu();
-       cpu_watchpoint_t *cwp;
-       int i, n;
-       bool unwatch_all = !have_addr;
+       const bool unwatch_all = !have_addr;
+       int n;
 
        n = 0;
-       for (i=0; i < ci->ci_cpuwatch_count; i++) {
-               cwp = &ci->ci_cpuwatch_tab[i];
+       for (u_int i=0; i < ci->ci_cpuwatch_count; i++) {
+               cpu_watchpoint_t * const cwp = &ci->ci_cpuwatch_tab[i];
                if (unwatch_all || (cwp->cw_addr == (register_t)address)) {
                        cpuwatch_free(cwp);
                        n++;
@@ -643,8 +642,7 @@
        }
        if (n == 0)
                db_printf("no watch found on address %#" PRIxREGISTER "\n",
-                       (register_t)address);
-
+                   (register_t)address);
 }
 #endif /* (MIPS32 + MIPS32R2 + MIPS64 + MIPS64R2) > 0 */
 



Home | Main Index | Thread Index | Old Index