All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] init/main.c: Fixes quoted string split across lines & missing blank line after declaration
@ 2017-07-28  6:26 janani-sankarababu
  2017-07-28 12:30 ` Steven Rostedt
  0 siblings, 1 reply; 2+ messages in thread
From: janani-sankarababu @ 2017-07-28  6:26 UTC (permalink / raw)
  To: mingo
  Cc: akpm, keescook, jeyu, tglx, rostedt, viresh.kumar, tj, prarit,
	lokeshvutla, linux-kernel, janani-sankarababu

Signed-off-by: Janani S <jananis37@gmail.com>
---
 init/main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/init/main.c b/init/main.c
index f8eb4966..920b829 100644
--- a/init/main.c
+++ b/init/main.c
@@ -176,6 +176,7 @@ static bool __init obsolete_checksetup(char *line)
 	p = __setup_start;
 	do {
 		int n = strlen(p->str);
+
 		if (parameqn(line, p->str, n)) {
 			if (p->early) {
 				/* Already done in parse_early_param?
@@ -302,6 +303,7 @@ static int __init unknown_bootoption(char *param, char *val,
 	if (val) {
 		/* Environment option */
 		unsigned int i;
+
 		for (i = 0; envp_init[i]; i++) {
 			if (i == MAX_INIT_ENVS) {
 				panic_later = "env";
@@ -314,6 +316,7 @@ static int __init unknown_bootoption(char *param, char *val,
 	} else {
 		/* Command line option */
 		unsigned int i;
+
 		for (i = 0; argv_init[i]; i++) {
 			if (i == MAX_INIT_ARGS) {
 				panic_later = "init";
@@ -1020,7 +1023,7 @@ static int __ref kernel_init(void *unused)
 	    !try_to_run_init_process("/bin/sh"))
 		return 0;
 
-	panic("No working init found.  Try passing init= option to kernel. "
+	panic("No working init found.  Try passing init= option to kernel.\n"
 	      "See Linux Documentation/admin-guide/init.rst for guidance.");
 }
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/2] init/main.c: Fixes quoted string split across lines & missing blank line after declaration
  2017-07-28  6:26 [PATCH 2/2] init/main.c: Fixes quoted string split across lines & missing blank line after declaration janani-sankarababu
@ 2017-07-28 12:30 ` Steven Rostedt
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2017-07-28 12:30 UTC (permalink / raw)
  To: janani-sankarababu
  Cc: mingo, akpm, keescook, jeyu, tglx, viresh.kumar, tj, prarit,
	lokeshvutla, linux-kernel

On Fri, 28 Jul 2017 11:56:46 +0530
janani-sankarababu <jananis37@gmail.com> wrote:

> Signed-off-by: Janani S <jananis37@gmail.com>
> ---
>  init/main.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/init/main.c b/init/main.c
> index f8eb4966..920b829 100644
> --- a/init/main.c
> +++ b/init/main.c
> @@ -176,6 +176,7 @@ static bool __init obsolete_checksetup(char *line)
>  	p = __setup_start;
>  	do {
>  		int n = strlen(p->str);
> +

Not sure this is really needed. It's in a block and being assigned. The
code looks fine as is.

>  		if (parameqn(line, p->str, n)) {
>  			if (p->early) {
>  				/* Already done in parse_early_param?
> @@ -302,6 +303,7 @@ static int __init unknown_bootoption(char *param, char *val,
>  	if (val) {
>  		/* Environment option */
>  		unsigned int i;
> +
>  		for (i = 0; envp_init[i]; i++) {
>  			if (i == MAX_INIT_ENVS) {
>  				panic_later = "env";
> @@ -314,6 +316,7 @@ static int __init unknown_bootoption(char *param, char *val,
>  	} else {
>  		/* Command line option */
>  		unsigned int i;
> +

This breaks up the flow of the blocks. The real fix isn't to add blank
lines, but to remove both of these i declarations and add just a single
one at the top of the function.

>  		for (i = 0; argv_init[i]; i++) {
>  			if (i == MAX_INIT_ARGS) {
>  				panic_later = "init";
> @@ -1020,7 +1023,7 @@ static int __ref kernel_init(void *unused)
>  	    !try_to_run_init_process("/bin/sh"))
>  		return 0;
>  
> -	panic("No working init found.  Try passing init= option to kernel. "
> +	panic("No working init found.  Try passing init= option to kernel.\n"
>  	      "See Linux Documentation/admin-guide/init.rst for guidance.");

This change is fine.

-- Steve

>  }
>  

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-28 12:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-28  6:26 [PATCH 2/2] init/main.c: Fixes quoted string split across lines & missing blank line after declaration janani-sankarababu
2017-07-28 12:30 ` Steven Rostedt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.