Patchwork [U-Boot,v3,11/16] main: Fix typos and checkpatch warnings in command line reading

login
register
mail settings
Submitter Simon Glass
Date Feb. 26, 2013, 4:11 p.m.
Message ID <1361895069-7343-12-git-send-email-sjg@chromium.org>
Download mbox | patch
Permalink /patch/223300/
State Deferred
Delegated to: Tom Rini
Headers show

Comments

Simon Glass - Feb. 26, 2013, 4:11 p.m.
There are a few over-long lines and other checkpatch problems in this area
of the code. Prepare the ground for the next patch by tidying these up.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v3:
- Separate out checkpatch fixes in command line reading code into new patch

Changes in v2: None

 common/main.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
Joe Hershberger - Feb. 27, 2013, 9:25 a.m.
Hi Simon,

On Tue, Feb 26, 2013 at 10:11 AM, Simon Glass <sjg@chromium.org> wrote:
> There are a few over-long lines and other checkpatch problems in this area
> of the code. Prepare the ground for the next patch by tidying these up.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> Changes in v3:
> - Separate out checkpatch fixes in command line reading code into new patch
>
> Changes in v2: None
>
>  common/main.c | 22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
>

Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>

Patch

diff --git a/common/main.c b/common/main.c
index d49692d..074ba60 100644
--- a/common/main.c
+++ b/common/main.c
@@ -1021,20 +1021,20 @@  int readline_into_buffer(const char *const prompt, char *buffer, int timeout)
 		 * Special character handling
 		 */
 		switch (c) {
-		case '\r':				/* Enter		*/
+		case '\r':			/* Enter		*/
 		case '\n':
 			*p = '\0';
 			puts ("\r\n");
-			return (p - p_buf);
+			return p - p_buf;
 
-		case '\0':				/* nul			*/
+		case '\0':			/* nul			*/
 			continue;
 
-		case 0x03:				/* ^C - break		*/
+		case 0x03:			/* ^C - break		*/
 			p_buf[0] = '\0';	/* discard input */
-			return (-1);
+			return -1;
 
-		case 0x15:				/* ^U - erase line	*/
+		case 0x15:			/* ^U - erase line	*/
 			while (col > plen) {
 				puts (erase_seq);
 				--col;
@@ -1043,15 +1043,15 @@  int readline_into_buffer(const char *const prompt, char *buffer, int timeout)
 			n = 0;
 			continue;
 
-		case 0x17:				/* ^W - erase word	*/
+		case 0x17:			/* ^W - erase word	*/
 			p=delete_char(p_buf, p, &col, &n, plen);
 			while ((n > 0) && (*p != ' ')) {
 				p=delete_char(p_buf, p, &col, &n, plen);
 			}
 			continue;
 
-		case 0x08:				/* ^H  - backspace	*/
-		case 0x7F:				/* DEL - backspace	*/
+		case 0x08:			/* ^H  - backspace	*/
+		case 0x7F:			/* DEL - backspace	*/
 			p=delete_char(p_buf, p, &col, &n, plen);
 			continue;
 
@@ -1060,7 +1060,7 @@  int readline_into_buffer(const char *const prompt, char *buffer, int timeout)
 			 * Must be a normal character then
 			 */
 			if (n < CONFIG_SYS_CBSIZE-2) {
-				if (c == '\t') {	/* expand TABs		*/
+				if (c == '\t') {	/* expand TABs */
 #ifdef CONFIG_AUTO_COMPLETE
 					/* if auto completion triggered just continue */
 					*p = '\0';
@@ -1075,7 +1075,7 @@  int readline_into_buffer(const char *const prompt, char *buffer, int timeout)
 					char buf[2];
 
 					/*
-					 * Echo input using puts() to force am
+					 * Echo input using puts() to force an
 					 * LCD flush if we are using an LCD
 					 */
 					++col;