Index: kernel/generic/src/console/kconsole.c
===================================================================
--- kernel/generic/src/console/kconsole.c	(revision f619ec11294d6774460c8c5c50473bf484647d12)
+++ kernel/generic/src/console/kconsole.c	(revision cf5ddf618974e3d854b08c9d0db88f2ad90fee8c)
@@ -80,5 +80,6 @@
 
 static cmd_info_t *parse_cmdline(char *cmdline, size_t len);
-static bool parse_argument(char *cmdline, size_t len, index_t *start, index_t *end);
+static bool parse_argument(char *cmdline, size_t len, index_t *start,
+    index_t *end);
 static char history[KCONSOLE_HISTORY][MAX_CMDLINE] = {};
 
@@ -89,5 +90,5 @@
 
 	cmd_init();
-	for (i=0; i<KCONSOLE_HISTORY; i++)
+	for (i = 0; i < KCONSOLE_HISTORY; i++)
 		history[i][0] = '\0';
 }
@@ -128,7 +129,6 @@
 			spinlock_lock(&hlp->lock);
 		}
-		if ((strncmp(hlp->name, 
-			     cmd->name, max(strlen(cmd->name),
-					    strlen(hlp->name))) == 0)) {
+		if ((strncmp(hlp->name, cmd->name, max(strlen(cmd->name),
+		    strlen(hlp->name))) == 0)) {
 			/* The command is already there. */
 			spinlock_unlock(&hlp->lock);
@@ -155,5 +155,5 @@
 {
 	int i;
-	for (i=0;i<count;i++)
+	for (i = 0; i < count; i++)
 		putchar(ch);
 }
@@ -164,6 +164,6 @@
 	int i;
 	
-	for (i=strlen(str);i > pos; i--)
-		str[i] = str[i-1];
+	for (i = strlen(str); i > pos; i--)
+		str[i] = str[i - 1];
 	str[pos] = ch;
 }
@@ -180,5 +180,5 @@
 		*startpos = cmd_head.next;
 
-	for (;*startpos != &cmd_head;*startpos = (*startpos)->next) {
+	for (; *startpos != &cmd_head; *startpos = (*startpos)->next) {
 		cmd_info_t *hlp;
 		hlp = list_get_instance(*startpos, cmd_info_t, link);
@@ -216,5 +216,6 @@
 			strncpy(output, foundtxt, strlen(foundtxt)+1);
 		else {
-			for (i=0; output[i] && foundtxt[i] && output[i]==foundtxt[i]; i++)
+			for (i = 0; output[i] && foundtxt[i] &&
+			    output[i] == foundtxt[i]; i++)
 				;
 			output[i] = '\0';
@@ -260,13 +261,13 @@
 			if (position == 0)
 				continue;
-			for (i=position; i<curlen;i++)
-				current[i-1] = current[i];
+			for (i = position; i < curlen; i++)
+				current[i - 1] = current[i];
 			curlen--;
 			position--;
 			putchar('\b');
-			for (i=position;i<curlen;i++)
+			for (i = position; i < curlen; i++)
 				putchar(current[i]);
 			putchar(' ');
-			rdln_print_c('\b',curlen-position+1);
+			rdln_print_c('\b', curlen - position + 1);
 			continue;
 		}
@@ -275,17 +276,18 @@
 
 			/* Move to the end of the word */
-			for (;position<curlen && current[position]!=' ';position++)
+			for (; position < curlen && current[position] != ' ';
+			    position++)
 				putchar(current[position]);
 			/* Copy to tmp last word */
-			for (i=position-1;i >= 0 && current[i]!=' ' ;i--)
+			for (i = position - 1; i >= 0 && current[i] != ' '; i--)
 				;
 			/* If word begins with * or &, skip it */
 			if (tmp[0] == '*' || tmp[0] == '&')
-				for (i=1;tmp[i];i++)
-					tmp[i-1] = tmp[i];
+				for (i = 1; tmp[i]; i++)
+					tmp[i - 1] = tmp[i];
 			i++; /* I is at the start of the word */
-			strncpy(tmp, current+i, position-i+1);
-
-			if (i==0) { /* Command completion */
+			strncpy(tmp, current + i, position - i + 1);
+
+			if (i == 0) { /* Command completion */
 				found = cmdtab_compl(tmp);
 			} else { /* Symtab completion */
@@ -295,13 +297,14 @@
 			if (found == 0) 
 				continue;
-			for (i=0;tmp[i] && curlen < MAX_CMDLINE;i++,curlen++)
-				insert_char(current, tmp[i], i+position);
-
-			if (strlen(tmp) || found==1) { /* If we have a hint */
-				for (i=position;i<curlen;i++) 
+			for (i = 0; tmp[i] && curlen < MAX_CMDLINE;
+			    i++, curlen++)
+				insert_char(current, tmp[i], i + position);
+
+			if (strlen(tmp) || found == 1) { /* If we have a hint */
+				for (i = position; i < curlen; i++) 
 					putchar(current[i]);
 				position += strlen(tmp);
 				/* Add space to end */
-				if (found == 1 && position == curlen && \
+				if (found == 1 && position == curlen &&
 				    curlen < MAX_CMDLINE) {
 					current[position] = ' ';
@@ -312,9 +315,9 @@
 			} else { /* No hint, table was printed */
 				printf("%s> ", prompt);
-				for (i=0; i<curlen;i++)
+				for (i = 0; i < curlen; i++)
 					putchar(current[i]);
 				position += strlen(tmp);
 			}
-			rdln_print_c('\b', curlen-position);
+			rdln_print_c('\b', curlen - position);
 			continue;
 		}
@@ -330,22 +333,19 @@
 				if (position == curlen)
 					continue;
-				for (i=position+1; i<curlen;i++) {
+				for (i = position + 1; i < curlen; i++) {
 					putchar(current[i]);
-					current[i-1] = current[i];
+					current[i - 1] = current[i];
 				}
 				putchar(' ');
-				rdln_print_c('\b',curlen-position);
+				rdln_print_c('\b', curlen - position);
 				curlen--;
-			}
-			else if (c == 0x48) { /* Home */
-				rdln_print_c('\b',position);
+			} else if (c == 0x48) { /* Home */
+				rdln_print_c('\b', position);
 				position = 0;
-			} 
-			else if (c == 0x46) {  /* End */
-				for (i=position;i<curlen;i++)
+			} else if (c == 0x46) {  /* End */
+				for (i = position; i < curlen; i++)
 					putchar(current[i]);
 				position = curlen;
-			}
-			else if (c == 0x44) { /* Left */
+			} else if (c == 0x44) { /* Left */
 				if (position > 0) {
 					putchar('\b');
@@ -353,6 +353,5 @@
 				}
 				continue;
-			}
-			else if (c == 0x43) { /* Right */
+			} else if (c == 0x43) { /* Right */
 				if (position < curlen) {
 					putchar(current[position]);
@@ -360,18 +359,19 @@
 				}
 				continue;
-			}
-			else if (c == 0x41 || c == 0x42) { 
-                                /* Up,down */
-				rdln_print_c('\b',position);
-				rdln_print_c(' ',curlen);
-				rdln_print_c('\b',curlen);
+			} else if (c == 0x41 || c == 0x42) { 
+                                /* Up, down */
+				rdln_print_c('\b', position);
+				rdln_print_c(' ', curlen);
+				rdln_print_c('\b', curlen);
 				if (c == 0x41) /* Up */
 					histposition--;
 				else
 					histposition++;
-				if (histposition < 0)
-					histposition = KCONSOLE_HISTORY -1 ;
-				else
-					histposition =  histposition % KCONSOLE_HISTORY;
+				if (histposition < 0) {
+					histposition = KCONSOLE_HISTORY - 1;
+				} else {
+					histposition =
+					    histposition % KCONSOLE_HISTORY;
+				}
 				current = history[histposition];
 				printf("%s", current);
@@ -388,8 +388,8 @@
 
 		curlen++;
-		for (i=position;i<curlen;i++)
+		for (i = position; i < curlen; i++)
 			putchar(current[i]);
 		position++;
-		rdln_print_c('\b',curlen-position);
+		rdln_print_c('\b',curlen - position);
 	} 
 	if (curlen) {
@@ -424,6 +424,6 @@
 		if (!cmd_info)
 			continue;
-		if (strncmp(cmd_info->name,"exit", \
-			    min(strlen(cmd_info->name),5)) == 0)
+		if (strncmp(cmd_info->name, "exit",
+		    min(strlen(cmd_info->name), 5)) == 0)
 			break;
 		(void) cmd_info->func(cmd_info->argv);
@@ -441,18 +441,20 @@
 	if (text[0] == '&') {
 		isaddr = true;
-		text++;len--;
+		text++;
+		len--;
 	} else if (text[0] == '*') {
 		isptr = true;
-		text++;len--;
+		text++;
+		len--;
 	}
 	if (text[0] < '0' || text[0] > '9') {
-		strncpy(symname, text, min(len+1, MAX_SYMBOL_NAME));
+		strncpy(symname, text, min(len + 1, MAX_SYMBOL_NAME));
 		symaddr = get_symbol_addr(symname);
 		if (!symaddr) {
-			printf("Symbol %s not found.\n",symname);
+			printf("Symbol %s not found.\n", symname);
 			return -1;
 		}
 		if (symaddr == (uintptr_t) -1) {
-			printf("Duplicate symbol %s.\n",symname);
+			printf("Duplicate symbol %s.\n", symname);
 			symtab_print_search(symname);
 			return -1;
@@ -502,5 +504,5 @@
 		
 		if (strncmp(hlp->name, &cmdline[start], max(strlen(hlp->name),
-							    end-start+1)) == 0) {
+		    end - start + 1)) == 0) {
 			cmd = hlp;
 			break;
@@ -540,24 +542,27 @@
 		case ARG_TYPE_STRING:
 		    	buf = cmd->argv[i].buffer;
-		    	strncpy(buf, (const char *) &cmdline[start], min((end - start) + 2, cmd->argv[i].len));
+		    	strncpy(buf, (const char *) &cmdline[start],
+			    min((end - start) + 2, cmd->argv[i].len));
 			buf[min((end - start) + 1, cmd->argv[i].len - 1)] = '\0';
 			break;
 		case ARG_TYPE_INT: 
-			if (parse_int_arg(cmdline+start, end-start+1, 
-					  &cmd->argv[i].intval))
+			if (parse_int_arg(cmdline + start, end - start + 1, 
+			    &cmd->argv[i].intval))
 				error = 1;
 			break;
 		case ARG_TYPE_VAR:
-			if (start != end && cmdline[start] == '"' && cmdline[end] == '"') {
+			if (start != end && cmdline[start] == '"' &&
+			    cmdline[end] == '"') {
 				buf = cmd->argv[i].buffer;
-				strncpy(buf, (const char *) &cmdline[start+1], 
-					min((end-start), cmd->argv[i].len));
-				buf[min((end - start), cmd->argv[i].len - 1)] = '\0';
+				strncpy(buf, (const char *) &cmdline[start + 1],
+				    min((end-start), cmd->argv[i].len));
+				buf[min((end - start), cmd->argv[i].len - 1)] =
+				    '\0';
 				cmd->argv[i].intval = (unative_t) buf;
 				cmd->argv[i].vartype = ARG_TYPE_STRING;
-			} else if (!parse_int_arg(cmdline+start, end-start+1, 
-						 &cmd->argv[i].intval))
+			} else if (!parse_int_arg(cmdline + start, end - start + 1, 
+			    &cmd->argv[i].intval)) {
 				cmd->argv[i].vartype = ARG_TYPE_INT;
-			else {
+			} else {
 				printf("Unrecognized variable argument.\n");
 				error = 1;
