diff mbox

[U-Boot,5/8] net/tftp.c: cosmetic: fix brace issues

Message ID 1305388203-22983-6-git-send-email-luca.ceresoli@comelit.it
State Accepted
Commit 7bc325a1b2dfda4a16789cc3b9387dbe1174af41
Headers show

Commit Message

Luca Ceresoli May 14, 2011, 3:50 p.m. UTC
This removes the following checkpatch issues:
 - WARNING: braces {} are not necessary for single statement blocks
 - WARNING: braces {} are not necessary for any arm of this statement

Signed-off-by: Luca Ceresoli <luca.ceresoli@comelit.it>
Cc: Wolfgang Denk <wd@denx.de>
---
 net/tftp.c |   17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

Comments

Wolfgang Denk May 19, 2011, 7:36 p.m. UTC | #1
Dear Luca Ceresoli,

In message <1305388203-22983-6-git-send-email-luca.ceresoli@comelit.it> you wrote:
> This removes the following checkpatch issues:
>  - WARNING: braces {} are not necessary for single statement blocks
>  - WARNING: braces {} are not necessary for any arm of this statement
> 
> Signed-off-by: Luca Ceresoli <luca.ceresoli@comelit.it>
> Cc: Wolfgang Denk <wd@denx.de>
> ---
>  net/tftp.c |   17 ++++++-----------
>  1 files changed, 6 insertions(+), 11 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk
diff mbox

Patch

diff --git a/net/tftp.c b/net/tftp.c
index 81b7aa5..eacd529 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -307,13 +307,11 @@  TftpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src,
 #endif
 		return;
 	}
-	if (TftpState != STATE_RRQ && src != TftpServerPort) {
+	if (TftpState != STATE_RRQ && src != TftpServerPort)
 		return;
-	}
 
-	if (len < 2) {
+	if (len < 2)
 		return;
-	}
 	len -= 2;
 	/* warning: don't use increment (++) in ntohs() macros!! */
 	s = (ushort *)pkt;
@@ -393,11 +391,10 @@  TftpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src,
 		}
 #endif
 		else {
-			if (((TftpBlock - 1) % 10) == 0) {
+			if (((TftpBlock - 1) % 10) == 0)
 				putc('#');
-			} else if ((TftpBlock % (10 * HASHES_PER_LINE)) == 0) {
+			else if ((TftpBlock % (10 * HASHES_PER_LINE)) == 0)
 				puts("\n\t ");
-			}
 		}
 
 		if (TftpState == STATE_RRQ)
@@ -638,13 +635,11 @@  TftpStart(void)
 
 #ifdef CONFIG_TFTP_PORT
 	ep = getenv("tftpdstp");
-	if (ep != NULL) {
+	if (ep != NULL)
 		TftpServerPort = simple_strtol(ep, NULL, 10);
-	}
 	ep = getenv("tftpsrcp");
-	if (ep != NULL) {
+	if (ep != NULL)
 		TftpOurPort = simple_strtol(ep, NULL, 10);
-	}
 #endif
 	TftpBlock = 0;