diff mbox

parisc: Add missing curly braces in puts()

Message ID 20171209114524.kwsvkd4ui5jei4r3@mwanda (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Dan Carpenter Dec. 9, 2017, 11:45 a.m. UTC
Static analysis tools complain that we intended to have curly braces
around this indent block.  Which is true.

Fixes: 2f3c7b8137ef ("parisc: Add core code for self-extracting kernel")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Helge Deller Dec. 9, 2017, 3:22 p.m. UTC | #1
On 09.12.2017 12:45, Dan Carpenter wrote:
> Static analysis tools complain that we intended to have curly braces
> around this indent block.  Which is true.

No, it's not.
I think the existing indenting is simply wrong and thus the static 
analysis tool assumes it wrongly.
I'll check and fix either way.

Helge
 
> Fixes: 2f3c7b8137ef ("parisc: Add core code for self-extracting kernel")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/arch/parisc/boot/compressed/misc.c b/arch/parisc/boot/compressed/misc.c
> index 9345b44b86f0..432d33804a86 100644
> --- a/arch/parisc/boot/compressed/misc.c
> +++ b/arch/parisc/boot/compressed/misc.c
> @@ -121,10 +121,11 @@ int puts(const char *s)
>  	const char *nuline = s;
>  
>  	while ((nuline = strchr(s, '\n')) != NULL) {
> -		if (nuline != s)
> +		if (nuline != s) {
>  			pdc_iodc_print(s, nuline - s);
>  			pdc_iodc_print("\r\n", 2);
>  			s = nuline + 1;
> +		}
>  	}
>  	if (*s != '\0')
>  		pdc_iodc_print(s, strlen(s));
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/parisc/boot/compressed/misc.c b/arch/parisc/boot/compressed/misc.c
index 9345b44b86f0..432d33804a86 100644
--- a/arch/parisc/boot/compressed/misc.c
+++ b/arch/parisc/boot/compressed/misc.c
@@ -121,10 +121,11 @@  int puts(const char *s)
 	const char *nuline = s;
 
 	while ((nuline = strchr(s, '\n')) != NULL) {
-		if (nuline != s)
+		if (nuline != s) {
 			pdc_iodc_print(s, nuline - s);
 			pdc_iodc_print("\r\n", 2);
 			s = nuline + 1;
+		}
 	}
 	if (*s != '\0')
 		pdc_iodc_print(s, strlen(s));