Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/emips/stand/common Remove unused variables



details:   https://anonhg.NetBSD.org/src/rev/57a5d5c399f7
branches:  trunk
changeset: 793705:57a5d5c399f7
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Feb 24 07:46:33 2014 +0000

description:
Remove unused variables

diffstat:

 sys/arch/emips/stand/common/boot.c |  315 ++++++++++++++++++------------------
 1 files changed, 157 insertions(+), 158 deletions(-)

diffs (truncated from 414 to 300 lines):

diff -r 203b1aac8a08 -r 57a5d5c399f7 sys/arch/emips/stand/common/boot.c
--- a/sys/arch/emips/stand/common/boot.c        Mon Feb 24 07:41:15 2014 +0000
+++ b/sys/arch/emips/stand/common/boot.c        Mon Feb 24 07:46:33 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: boot.c,v 1.1 2011/01/26 01:18:54 pooka Exp $   */
+/*     $NetBSD: boot.c,v 1.2 2014/02/24 07:46:33 martin Exp $  */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
        "netbsd.old",
        "onetbsd",
        "gennetbsd",
-    "nfsnetbsd",
+       "nfsnetbsd",
        NULL
 };
 
@@ -66,9 +66,9 @@
 
 static int loadit(char *name, u_long marks[MARK_MAX])
 {
-    printf("Loading: %s\n", name);
-    memset(marks, 0, sizeof marks);
-    return (loadfile(name, marks, LOAD_ALL));
+       printf("Loading: %s\n", name);
+       memset(marks, 0, sizeof marks);
+       return (loadfile(name, marks, LOAD_ALL));
 }
 
 /*
@@ -78,31 +78,30 @@
 void
 main(char *stack_top)
 {
-       int argc;
-    int autoboot = 1, win;
+       int autoboot = 1, win;
        char *name, **namep, *dev, *kernel;
-       char bootname[PATH_MAX], bootpath[PATH_MAX], options[OPT_MAX];
+       char bootpath[PATH_MAX], options[OPT_MAX];
        uint32_t entry;
        u_long marks[MARK_MAX];
        struct btinfo_symtab bi_syms;
        struct btinfo_bootpath bi_bpath;
 
-    /* Init all peripherals, esp USART for printf and memory */
-    init_board();
+       /* Init all peripherals, esp USART for printf and memory */
+       init_board();
 
-    /* On account of compression, we need a fairly large heap.
-     * To keep things simple, take one meg just below the 16 meg mark.
-     * That allows for a large kernel, and a 16MB configuration still works.
-     */
-    setheap((void *)(0x81000000-(1024*1024)), (void *)0x81000000);
+       /* On account of compression, we need a fairly large heap.
+        * To keep things simple, take one meg just below the 16 meg mark.
+        * That allows for a large kernel, and a 16MB configuration still works.
+        */
+       setheap((void *)(0x81000000-(1024*1024)), (void *)0x81000000);
 
-    /* On the BEE3 and the Giano simulator, we need a sec between the serial-line download complete
-     * and switching the serial line to PuTTY as console. Get a char to pause.
-     * This delay is also the practice on PCs so.
-     */
-    Delay(200000);
-    printf("Hit any char to boot..");
-    argc = GetChar();
+       /* On the BEE3 and the Giano simulator, we need a sec between the serial-line download complete
+        * and switching the serial line to PuTTY as console. Get a char to pause.
+        * This delay is also the practice on PCs so.
+        */
+       Delay(200000);
+       printf("Hit any char to boot..");
+       (void)GetChar();
 
        /* print a banner */
        printf("\n");
@@ -112,25 +111,25 @@
        /* initialise bootinfo structure early */
        bi_init(BOOTINFO_ADDR);
 
-    /* Default is to auto-boot from the first disk */
-    dev = "0/ace(0,0)/";
+       /* Default is to auto-boot from the first disk */
+       dev = "0/ace(0,0)/";
        kernel = kernelnames[0];
-    options[0] = 0;
+       options[0] = 0;
 
-    win = 0;
-    for (;!win;) {
-        strcpy(bootpath, dev);
-        strcat(bootpath, kernel);
-        name = getboot(bootpath,options);
+       win = 0;
+       for (;!win;) {
+           strcpy(bootpath, dev);
+           strcat(bootpath, kernel);
+           name = getboot(bootpath,options);
 
-        if (name != NULL) {
-            win = (loadit(name, marks) == 0);
-        } else if (autoboot)
-            break;
-        autoboot = 0;
-    }
+           if (name != NULL) {
+               win = (loadit(name, marks) == 0);
+           } else if (autoboot)
+               break;
+           autoboot = 0;
+       }
 
-    if (!win) {
+       if (!win) {
                for (namep = kernelnames, win = 0; *namep != NULL && !win;
                    namep++) {
                        kernel = *namep;
@@ -155,7 +154,7 @@
        bi_add(&bi_syms, BTINFO_SYMTAB, sizeof(bi_syms));
 
        printf("Starting at 0x%x\n\n", entry);
-    call_kernel(entry, name, options, BOOTINFO_MAGIC, bootinfo);
+       call_kernel(entry, name, options, BOOTINFO_MAGIC, bootinfo);
        (void)printf("KERNEL RETURNED!\n");
 
 fail:
@@ -165,90 +164,90 @@
 static inline int
 parse(char *cmd, char *kname, char *optarg)
 {
-    char *arg = cmd;
-    char *ep, *p;
-    int c, i;
+       char *arg = cmd;
+       char *ep, *p;
+       int c, i;
 
-    while ((c = *arg++)) {
-        /* skip leading blanks */
-        if (c == ' ' || c == '\t' || c == '\n')
-            continue;
-        /* find separator, or eol */
-        for (p = arg; *p && *p != '\n' && *p != ' ' && *p != '\t'; p++);
-        ep = p;
-        /* trim if separator */
-        if (*p)
-            *p++ = 0;
-        /* token is either "-opts" or "kernelname" */
-        if (c == '-') {
-            /* no overflow because whole line same length as optarg anyways */
-            while ((c = *arg++)) {
-                *optarg++ = c;
-            }
-            *optarg = 0;
-        } else {
-            arg--;
-            if ((i = ep - arg)) {
-                if ((size_t)i >= PATH_MAX)
-                    return -1;
-                memcpy(kname, arg, i + 1);
-            }
-        }
-        arg = p;
-    }
-    return 0;
+       while ((c = *arg++)) {
+           /* skip leading blanks */
+           if (c == ' ' || c == '\t' || c == '\n')
+               continue;
+           /* find separator, or eol */
+           for (p = arg; *p && *p != '\n' && *p != ' ' && *p != '\t'; p++);
+           ep = p;
+           /* trim if separator */
+           if (*p)
+               *p++ = 0;
+           /* token is either "-opts" or "kernelname" */
+           if (c == '-') {
+               /* no overflow because whole line same length as optarg anyways */
+               while ((c = *arg++)) {
+                   *optarg++ = c;
+               }
+               *optarg = 0;
+           } else {
+               arg--;
+               if ((i = ep - arg)) {
+                   if ((size_t)i >= PATH_MAX)
+                       return -1;
+                   memcpy(kname, arg, i + 1);
+               }
+           }
+           arg = p;
+       }
+       return 0;
 }
 
 /* String returned is zero-terminated and at most PATH_MAX chars */
 static inline void
 getstr(char *cmd, int c)
 {
-    char *s;
+       char *s;
 
-    s = cmd;
-    if (c == 0)
-        c = GetChar();
-    for (;;) {
-        switch (c) {
-        case 0:
-            break;
-        case '\177':
-        case '\b':
-            if (s > cmd) {
-                s--;
-                printf("\b \b");
-            }
-            break;
-        case '\n':
-        case '\r':
-            *s = 0;
-            return;
-        default:
-            if ((s - cmd) < (PATH_MAX - 1))
-                *s++ = c;
-            xputchar(c);
-        }
-        c = GetChar();
-    }
+       s = cmd;
+       if (c == 0)
+           c = GetChar();
+       for (;;) {
+           switch (c) {
+           case 0:
+               break;
+           case '\177':
+           case '\b':
+               if (s > cmd) {
+                   s--;
+                   printf("\b \b");
+               }
+               break;
+           case '\n':
+           case '\r':
+               *s = 0;
+               return;
+           default:
+               if ((s - cmd) < (PATH_MAX - 1))
+                   *s++ = c;
+               xputchar(c);
+           }
+           c = GetChar();
+       }
 }
 
 char *getboot(char *kname, char* optarg)
 {
-    char c = 0;
-    char cmd[PATH_MAX];
+       char c = 0;
+       char cmd[PATH_MAX];
 
-    printf("\nDefault: %s%s %s\nboot: ", (*optarg) ? "-" : "", optarg, kname);
-    if ((c = GetChar()) == -1)
-        return NULL;
+       printf("\nDefault: %s%s %s\nboot: ", (*optarg) ? "-" : "", optarg, kname);
+       if ((c = GetChar()) == -1)
+           return NULL;
 
-    cmd[0] = 0;
-    getstr(cmd,c);
-    xputchar('\n');
-    if (parse(cmd,kname,optarg))
-        xputchar('\a');
-    else if (devcanon(kname) == 0)
-        return kname;
-    return NULL;
+       cmd[0] = 0;
+       getstr(cmd,c);
+       xputchar('\n');
+       if (parse(cmd,kname,optarg))
+           xputchar('\a');
+       else if (devcanon(kname) == 0)
+           return kname;
+       return NULL;
 }
 
 /*
@@ -258,73 +257,73 @@
 devcanon(char *fname)
 {
        int ctlr = 0, unit = 0, part = 0;
-       int c, rc;
+       int c;
        char device_name[20];
-    char file_name[PATH_MAX];
+       char file_name[PATH_MAX];
        const char *cp;



Home | Main Index | Thread Index | Old Index