linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] init: calibrate: fix style issues
@ 2014-10-11 16:31 Rasmus Wriedt Larsen
  2014-10-11 16:40 ` Joe Perches
  0 siblings, 1 reply; 7+ messages in thread
From: Rasmus Wriedt Larsen @ 2014-10-11 16:31 UTC (permalink / raw)
  To: pdeschrijver; +Cc: rmk+kernel, swarren, linux-kernel, Rasmus Wriedt Larsen

* fix multiple quoted string split across lines style issues
* change printk(KERN_NOTICE to pr_notice
* insert spaces after , in function call

Signed-off-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
---
 init/calibrate.c | 34 +++++++++++++---------------------
 1 file changed, 13 insertions(+), 21 deletions(-)

diff --git a/init/calibrate.c b/init/calibrate.c
index ce635dc..3cfd911 100644
--- a/init/calibrate.c
+++ b/init/calibrate.c
@@ -15,7 +15,7 @@ unsigned long lpj_fine;
 unsigned long preset_lpj;
 static int __init lpj_setup(char *str)
 {
-	preset_lpj = simple_strtoul(str,NULL,0);
+	preset_lpj = simple_strtoul(str, NULL, 0);
 	return 1;
 }
 
@@ -40,11 +40,13 @@ static unsigned long calibrate_delay_direct(void)
 	unsigned long good_timer_sum = 0;
 	unsigned long good_timer_count = 0;
 	unsigned long measured_times[MAX_DIRECT_CALIBRATION_RETRIES];
-	int max = -1; /* index of measured_times with max/min values or not set */
+
+	/* index of measured_times with max/min values or not set */
+	int max = -1;
 	int min = -1;
 	int i;
 
-	if (read_current_timer(&pre_start) < 0 )
+	if (read_current_timer(&pre_start) < 0)
 		return 0;
 
 	/*
@@ -95,9 +97,7 @@ static unsigned long calibrate_delay_direct(void)
 		 * >= 12.5% apart, redo calibration.
 		 */
 		if (start >= post_end)
-			printk(KERN_NOTICE "calibrate_delay_direct() ignoring "
-					"timer_rate as we had a TSC wrap around"
-					" start=%lu >=post_end=%lu\n",
+			pr_notice("calibrate_delay_direct() ignoring timer_rate as we had a TSC wrap around start=%lu >=post_end=%lu\n",
 				start, post_end);
 		if (start < post_end && pre_start != 0 && pre_end != 0 &&
 		    (timer_rate_max - timer_rate_min) < (timer_rate_max >> 3)) {
@@ -134,14 +134,12 @@ static unsigned long calibrate_delay_direct(void)
 		good_timer_count = 0;
 		if ((measured_times[max] - estimate) <
 				(estimate - measured_times[min])) {
-			printk(KERN_NOTICE "calibrate_delay_direct() dropping "
-					"min bogoMips estimate %d = %lu\n",
+			pr_notice("calibrate_delay_direct() dropping min bogoMips estimate %d = %lu\n",
 				min, measured_times[min]);
 			measured_times[min] = 0;
 			min = max;
 		} else {
-			printk(KERN_NOTICE "calibrate_delay_direct() dropping "
-					"max bogoMips estimate %d = %lu\n",
+			pr_notice("calibrate_delay_direct() dropping max bogoMips estimate %d = %lu\n",
 				max, measured_times[max]);
 			measured_times[max] = 0;
 			max = min;
@@ -160,9 +158,7 @@ static unsigned long calibrate_delay_direct(void)
 
 	}
 
-	printk(KERN_NOTICE "calibrate_delay_direct() failed to get a good "
-	       "estimate for loops_per_jiffy.\nProbably due to long platform "
-		"interrupts. Consider using \"lpj=\" boot option.\n");
+	pr_notice("calibrate_delay_direct() failed to get a good estimate for loops_per_jiffy.\nProbably due to long platform interrupts. Consider using \"lpj=\" boot option.\n");
 	return 0;
 }
 #else
@@ -280,23 +276,19 @@ void calibrate_delay(void)
 	if (per_cpu(cpu_loops_per_jiffy, this_cpu)) {
 		lpj = per_cpu(cpu_loops_per_jiffy, this_cpu);
 		if (!printed)
-			pr_info("Calibrating delay loop (skipped) "
-				"already calibrated this CPU");
+			pr_info("Calibrating delay loop (skipped) already calibrated this CPU");
 	} else if (preset_lpj) {
 		lpj = preset_lpj;
 		if (!printed)
-			pr_info("Calibrating delay loop (skipped) "
-				"preset value.. ");
+			pr_info("Calibrating delay loop (skipped) preset value.. ");
 	} else if ((!printed) && lpj_fine) {
 		lpj = lpj_fine;
-		pr_info("Calibrating delay loop (skipped), "
-			"value calculated using timer frequency.. ");
+		pr_info("Calibrating delay loop (skipped), value calculated using timer frequency.. ");
 	} else if ((lpj = calibrate_delay_is_known())) {
 		;
 	} else if ((lpj = calibrate_delay_direct()) != 0) {
 		if (!printed)
-			pr_info("Calibrating delay using timer "
-				"specific routine.. ");
+			pr_info("Calibrating delay using timer specific routine.. ");
 	} else {
 		if (!printed)
 			pr_info("Calibrating delay loop... ");
-- 
1.9.1


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

* Re: [PATCH] init: calibrate: fix style issues
  2014-10-11 16:31 [PATCH] init: calibrate: fix style issues Rasmus Wriedt Larsen
@ 2014-10-11 16:40 ` Joe Perches
  2014-10-11 17:23   ` Rasmus Wriedt Larsen
  0 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2014-10-11 16:40 UTC (permalink / raw)
  To: Rasmus Wriedt Larsen; +Cc: pdeschrijver, rmk+kernel, swarren, linux-kernel

On Sat, 2014-10-11 at 18:31 +0200, Rasmus Wriedt Larsen wrote:
> * fix multiple quoted string split across lines style issues
> * change printk(KERN_NOTICE to pr_notice
> * insert spaces after , in function call
[]
> diff --git a/init/calibrate.c b/init/calibrate.c
[]
> @@ -160,9 +158,7 @@ static unsigned long calibrate_delay_direct(void)
>  
>  	}
>  
> -	printk(KERN_NOTICE "calibrate_delay_direct() failed to get a good "
> -	       "estimate for loops_per_jiffy.\nProbably due to long platform "
> -		"interrupts. Consider using \"lpj=\" boot option.\n");
> +	pr_notice("calibrate_delay_direct() failed to get a good estimate for loops_per_jiffy.\nProbably due to long platform interrupts. Consider using \"lpj=\" boot option.\n");

This would be better on 2 lines:
	pr_notice("calibrate_delay_direct() failed to get a good estimate for loops_per_jiffy.\n"
		  "Probably due to long platform interrupts. Consider using \"lpj=\" boot option.\n");

The grammar is poor though and this
could be better phrased.


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

* Re: [PATCH] init: calibrate: fix style issues
  2014-10-11 16:40 ` Joe Perches
@ 2014-10-11 17:23   ` Rasmus Wriedt Larsen
  2014-10-11 17:36     ` Joe Perches
  0 siblings, 1 reply; 7+ messages in thread
From: Rasmus Wriedt Larsen @ 2014-10-11 17:23 UTC (permalink / raw)
  To: Joe Perches; +Cc: pdeschrijver, rmk+kernel, swarren, linux-kernel

On 11/10/14 18:40, Joe Perches wrote:
> On Sat, 2014-10-11 at 18:31 +0200, Rasmus Wriedt Larsen wrote:
>> * fix multiple quoted string split across lines style issues
>> * change printk(KERN_NOTICE to pr_notice
>> * insert spaces after , in function call
> []
>> diff --git a/init/calibrate.c b/init/calibrate.c
> []
>> @@ -160,9 +158,7 @@ static unsigned long calibrate_delay_direct(void)
>>  
>>  	}
>>  
>> -	printk(KERN_NOTICE "calibrate_delay_direct() failed to get a good "
>> -	       "estimate for loops_per_jiffy.\nProbably due to long platform "
>> -		"interrupts. Consider using \"lpj=\" boot option.\n");
>> +	pr_notice("calibrate_delay_direct() failed to get a good estimate for loops_per_jiffy.\nProbably due to long platform interrupts. Consider using \"lpj=\" boot option.\n");
> 
> This would be better on 2 lines:
> 	pr_notice("calibrate_delay_direct() failed to get a good estimate for loops_per_jiffy.\n"
> 		  "Probably due to long platform interrupts. Consider using \"lpj=\" boot option.\n");

Yes, indeed it would. (will fix in upcoming patch)

> The grammar is poor though and this
> could be better phrased.

Any suggestions? I don't see anything in particular (but English is not my
native language either)

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

* Re: [PATCH] init: calibrate: fix style issues
  2014-10-11 17:23   ` Rasmus Wriedt Larsen
@ 2014-10-11 17:36     ` Joe Perches
  2014-10-13 10:12       ` [PATCH v2] " Rasmus Wriedt Larsen
  0 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2014-10-11 17:36 UTC (permalink / raw)
  To: Rasmus Wriedt Larsen; +Cc: pdeschrijver, rmk+kernel, swarren, linux-kernel

On Sat, 2014-10-11 at 19:23 +0200, Rasmus Wriedt Larsen wrote:
> On 11/10/14 18:40, Joe Perches wrote:
> > On Sat, 2014-10-11 at 18:31 +0200, Rasmus Wriedt Larsen wrote:
> >> * fix multiple quoted string split across lines style issues
> >> * change printk(KERN_NOTICE to pr_notice
> >> * insert spaces after , in function call
> > []
> >> diff --git a/init/calibrate.c b/init/calibrate.c
> > []
> >> @@ -160,9 +158,7 @@ static unsigned long calibrate_delay_direct(void)
> >>  
> >>  	}
> >>  
> >> -	printk(KERN_NOTICE "calibrate_delay_direct() failed to get a good "
> >> -	       "estimate for loops_per_jiffy.\nProbably due to long platform "
> >> -		"interrupts. Consider using \"lpj=\" boot option.\n");
> >> +	pr_notice("calibrate_delay_direct() failed to get a good estimate for loops_per_jiffy.\nProbably due to long platform interrupts. Consider using \"lpj=\" boot option.\n");
> > 
> > This would be better on 2 lines:
> > 	pr_notice("calibrate_delay_direct() failed to get a good estimate for loops_per_jiffy.\n"
> > 		  "Probably due to long platform interrupts. Consider using \"lpj=\" boot option.\n");
> 
> Yes, indeed it would. (will fix in upcoming patch)
> 
> > The grammar is poor though and this
> > could be better phrased.
> 
> Any suggestions? I don't see anything in particular (but English is not my
> native language either)

I'd suggest something on a single line like:

	pr_notice("%s: failed to reasonably estimate loops_per_jiffy (long platform interrupts?) - perhaps use boot option 'lpj='\n",
		  __func__);

I prefer complete individual messages and don't
mind longer dmesg message lines.



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

* [PATCH v2] init: calibrate: fix style issues
  2014-10-11 17:36     ` Joe Perches
@ 2014-10-13 10:12       ` Rasmus Wriedt Larsen
  2014-12-08 20:56         ` Rasmus Wriedt Larsen
  0 siblings, 1 reply; 7+ messages in thread
From: Rasmus Wriedt Larsen @ 2014-10-13 10:12 UTC (permalink / raw)
  To: joe; +Cc: pdeschrijver, rmk+kernel, swarren, linux-kernel,
	Rasmus Wriedt Larsen

* fix multiple quoted string split across lines style issues
* change printk(KERN_NOTICE to pr_notice
* insert spaces after , in function call
* change two line pr_notice msg to one line (credit: Joe Perches)

Signed-off-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
---
 init/calibrate.c | 35 ++++++++++++++---------------------
 1 file changed, 14 insertions(+), 21 deletions(-)

diff --git a/init/calibrate.c b/init/calibrate.c
index ce635dc..d9c8810 100644
--- a/init/calibrate.c
+++ b/init/calibrate.c
@@ -15,7 +15,7 @@ unsigned long lpj_fine;
 unsigned long preset_lpj;
 static int __init lpj_setup(char *str)
 {
-	preset_lpj = simple_strtoul(str,NULL,0);
+	preset_lpj = simple_strtoul(str, NULL, 0);
 	return 1;
 }

@@ -40,11 +40,13 @@ static unsigned long calibrate_delay_direct(void)
 	unsigned long good_timer_sum = 0;
 	unsigned long good_timer_count = 0;
 	unsigned long measured_times[MAX_DIRECT_CALIBRATION_RETRIES];
-	int max = -1; /* index of measured_times with max/min values or not set */
+
+	/* index of measured_times with max/min values or not set */
+	int max = -1;
 	int min = -1;
 	int i;

-	if (read_current_timer(&pre_start) < 0 )
+	if (read_current_timer(&pre_start) < 0)
 		return 0;

 	/*
@@ -95,9 +97,7 @@ static unsigned long calibrate_delay_direct(void)
 		 * >= 12.5% apart, redo calibration.
 		 */
 		if (start >= post_end)
-			printk(KERN_NOTICE "calibrate_delay_direct() ignoring "
-					"timer_rate as we had a TSC wrap around"
-					" start=%lu >=post_end=%lu\n",
+			pr_notice("calibrate_delay_direct() ignoring timer_rate as we had a TSC wrap around start=%lu >=post_end=%lu\n",
 				start, post_end);
 		if (start < post_end && pre_start != 0 && pre_end != 0 &&
 		    (timer_rate_max - timer_rate_min) < (timer_rate_max >> 3)) {
@@ -134,14 +134,12 @@ static unsigned long calibrate_delay_direct(void)
 		good_timer_count = 0;
 		if ((measured_times[max] - estimate) <
 				(estimate - measured_times[min])) {
-			printk(KERN_NOTICE "calibrate_delay_direct() dropping "
-					"min bogoMips estimate %d = %lu\n",
+			pr_notice("calibrate_delay_direct() dropping min bogoMips estimate %d = %lu\n",
 				min, measured_times[min]);
 			measured_times[min] = 0;
 			min = max;
 		} else {
-			printk(KERN_NOTICE "calibrate_delay_direct() dropping "
-					"max bogoMips estimate %d = %lu\n",
+			pr_notice("calibrate_delay_direct() dropping max bogoMips estimate %d = %lu\n",
 				max, measured_times[max]);
 			measured_times[max] = 0;
 			max = min;
@@ -160,9 +158,8 @@ static unsigned long calibrate_delay_direct(void)

 	}

-	printk(KERN_NOTICE "calibrate_delay_direct() failed to get a good "
-	       "estimate for loops_per_jiffy.\nProbably due to long platform "
-		"interrupts. Consider using \"lpj=\" boot option.\n");
+	pr_notice("%s: failed to reasonably estimate loops_per_jiffy (long platform interrupts?) - perhaps use boot option 'lpj='\n",
+		  __func__);
 	return 0;
 }
 #else
@@ -280,23 +277,19 @@ void calibrate_delay(void)
 	if (per_cpu(cpu_loops_per_jiffy, this_cpu)) {
 		lpj = per_cpu(cpu_loops_per_jiffy, this_cpu);
 		if (!printed)
-			pr_info("Calibrating delay loop (skipped) "
-				"already calibrated this CPU");
+			pr_info("Calibrating delay loop (skipped) already calibrated this CPU");
 	} else if (preset_lpj) {
 		lpj = preset_lpj;
 		if (!printed)
-			pr_info("Calibrating delay loop (skipped) "
-				"preset value.. ");
+			pr_info("Calibrating delay loop (skipped) preset value.. ");
 	} else if ((!printed) && lpj_fine) {
 		lpj = lpj_fine;
-		pr_info("Calibrating delay loop (skipped), "
-			"value calculated using timer frequency.. ");
+		pr_info("Calibrating delay loop (skipped), value calculated using timer frequency.. ");
 	} else if ((lpj = calibrate_delay_is_known())) {
 		;
 	} else if ((lpj = calibrate_delay_direct()) != 0) {
 		if (!printed)
-			pr_info("Calibrating delay using timer "
-				"specific routine.. ");
+			pr_info("Calibrating delay using timer specific routine.. ");
 	} else {
 		if (!printed)
 			pr_info("Calibrating delay loop... ");
--
1.9.1


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

* Re: [PATCH v2] init: calibrate: fix style issues
  2014-10-13 10:12       ` [PATCH v2] " Rasmus Wriedt Larsen
@ 2014-12-08 20:56         ` Rasmus Wriedt Larsen
  2014-12-09  0:24           ` Joe Perches
  0 siblings, 1 reply; 7+ messages in thread
From: Rasmus Wriedt Larsen @ 2014-12-08 20:56 UTC (permalink / raw)
  To: rmk+kernel; +Cc: pdeschrijver, joe, swarren, linux-kernel

Wanted to bump this patch, as nothing has happened in a long time.

As this is my first linux patch, I was quite hoping to get it accepted :)

On 13/10/14 12:12, Rasmus Wriedt Larsen wrote:
> * fix multiple quoted string split across lines style issues
> * change printk(KERN_NOTICE to pr_notice
> * insert spaces after , in function call
> * change two line pr_notice msg to one line (credit: Joe Perches)
> 
> Signed-off-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
> ---
>  init/calibrate.c | 35 ++++++++++++++---------------------
>  1 file changed, 14 insertions(+), 21 deletions(-)
> 
> diff --git a/init/calibrate.c b/init/calibrate.c
> index ce635dc..d9c8810 100644
> --- a/init/calibrate.c
> +++ b/init/calibrate.c
> @@ -15,7 +15,7 @@ unsigned long lpj_fine;
>  unsigned long preset_lpj;
>  static int __init lpj_setup(char *str)
>  {
> -	preset_lpj = simple_strtoul(str,NULL,0);
> +	preset_lpj = simple_strtoul(str, NULL, 0);
>  	return 1;
>  }
> 
> @@ -40,11 +40,13 @@ static unsigned long calibrate_delay_direct(void)
>  	unsigned long good_timer_sum = 0;
>  	unsigned long good_timer_count = 0;
>  	unsigned long measured_times[MAX_DIRECT_CALIBRATION_RETRIES];
> -	int max = -1; /* index of measured_times with max/min values or not set */
> +
> +	/* index of measured_times with max/min values or not set */
> +	int max = -1;
>  	int min = -1;
>  	int i;
> 
> -	if (read_current_timer(&pre_start) < 0 )
> +	if (read_current_timer(&pre_start) < 0)
>  		return 0;
> 
>  	/*
> @@ -95,9 +97,7 @@ static unsigned long calibrate_delay_direct(void)
>  		 * >= 12.5% apart, redo calibration.
>  		 */
>  		if (start >= post_end)
> -			printk(KERN_NOTICE "calibrate_delay_direct() ignoring "
> -					"timer_rate as we had a TSC wrap around"
> -					" start=%lu >=post_end=%lu\n",
> +			pr_notice("calibrate_delay_direct() ignoring timer_rate as we had a TSC wrap around start=%lu >=post_end=%lu\n",
>  				start, post_end);
>  		if (start < post_end && pre_start != 0 && pre_end != 0 &&
>  		    (timer_rate_max - timer_rate_min) < (timer_rate_max >> 3)) {
> @@ -134,14 +134,12 @@ static unsigned long calibrate_delay_direct(void)
>  		good_timer_count = 0;
>  		if ((measured_times[max] - estimate) <
>  				(estimate - measured_times[min])) {
> -			printk(KERN_NOTICE "calibrate_delay_direct() dropping "
> -					"min bogoMips estimate %d = %lu\n",
> +			pr_notice("calibrate_delay_direct() dropping min bogoMips estimate %d = %lu\n",
>  				min, measured_times[min]);
>  			measured_times[min] = 0;
>  			min = max;
>  		} else {
> -			printk(KERN_NOTICE "calibrate_delay_direct() dropping "
> -					"max bogoMips estimate %d = %lu\n",
> +			pr_notice("calibrate_delay_direct() dropping max bogoMips estimate %d = %lu\n",
>  				max, measured_times[max]);
>  			measured_times[max] = 0;
>  			max = min;
> @@ -160,9 +158,8 @@ static unsigned long calibrate_delay_direct(void)
> 
>  	}
> 
> -	printk(KERN_NOTICE "calibrate_delay_direct() failed to get a good "
> -	       "estimate for loops_per_jiffy.\nProbably due to long platform "
> -		"interrupts. Consider using \"lpj=\" boot option.\n");
> +	pr_notice("%s: failed to reasonably estimate loops_per_jiffy (long platform interrupts?) - perhaps use boot option 'lpj='\n",
> +		  __func__);
>  	return 0;
>  }
>  #else
> @@ -280,23 +277,19 @@ void calibrate_delay(void)
>  	if (per_cpu(cpu_loops_per_jiffy, this_cpu)) {
>  		lpj = per_cpu(cpu_loops_per_jiffy, this_cpu);
>  		if (!printed)
> -			pr_info("Calibrating delay loop (skipped) "
> -				"already calibrated this CPU");
> +			pr_info("Calibrating delay loop (skipped) already calibrated this CPU");
>  	} else if (preset_lpj) {
>  		lpj = preset_lpj;
>  		if (!printed)
> -			pr_info("Calibrating delay loop (skipped) "
> -				"preset value.. ");
> +			pr_info("Calibrating delay loop (skipped) preset value.. ");
>  	} else if ((!printed) && lpj_fine) {
>  		lpj = lpj_fine;
> -		pr_info("Calibrating delay loop (skipped), "
> -			"value calculated using timer frequency.. ");
> +		pr_info("Calibrating delay loop (skipped), value calculated using timer frequency.. ");
>  	} else if ((lpj = calibrate_delay_is_known())) {
>  		;
>  	} else if ((lpj = calibrate_delay_direct()) != 0) {
>  		if (!printed)
> -			pr_info("Calibrating delay using timer "
> -				"specific routine.. ");
> +			pr_info("Calibrating delay using timer specific routine.. ");
>  	} else {
>  		if (!printed)
>  			pr_info("Calibrating delay loop... ");
> --
> 1.9.1
> 

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

* Re: [PATCH v2] init: calibrate: fix style issues
  2014-12-08 20:56         ` Rasmus Wriedt Larsen
@ 2014-12-09  0:24           ` Joe Perches
  0 siblings, 0 replies; 7+ messages in thread
From: Joe Perches @ 2014-12-09  0:24 UTC (permalink / raw)
  To: Rasmus Wriedt Larsen, Andrew Morton, Jiri Kosina
  Cc: rmk+kernel, pdeschrijver, swarren, linux-kernel

On Mon, 2014-12-08 at 21:56 +0100, Rasmus Wriedt Larsen wrote:
> Wanted to bump this patch, as nothing has happened in a long time.

Maybe you need to expand the recipient list.
Andrew Morton sometimes picks up patches like this.
Sometimes Jiri Kosina, the trivial maintainer, does.
Both have been added to the recipient list here.

> As this is my first linux patch, I was quite hoping to get it accepted :)
> 
> On 13/10/14 12:12, Rasmus Wriedt Larsen wrote:
> > * fix multiple quoted string split across lines style issues
> > * change printk(KERN_NOTICE to pr_notice
> > * insert spaces after , in function call
> > * change two line pr_notice msg to one line (credit: Joe Perches)
> > 
> > Signed-off-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
> > ---
> >  init/calibrate.c | 35 ++++++++++++++---------------------
> >  1 file changed, 14 insertions(+), 21 deletions(-)
> > 
> > diff --git a/init/calibrate.c b/init/calibrate.c
> > index ce635dc..d9c8810 100644
> > --- a/init/calibrate.c
> > +++ b/init/calibrate.c
> > @@ -15,7 +15,7 @@ unsigned long lpj_fine;
> >  unsigned long preset_lpj;
> >  static int __init lpj_setup(char *str)
> >  {
> > -	preset_lpj = simple_strtoul(str,NULL,0);
> > +	preset_lpj = simple_strtoul(str, NULL, 0);
> >  	return 1;
> >  }
> > 
> > @@ -40,11 +40,13 @@ static unsigned long calibrate_delay_direct(void)
> >  	unsigned long good_timer_sum = 0;
> >  	unsigned long good_timer_count = 0;
> >  	unsigned long measured_times[MAX_DIRECT_CALIBRATION_RETRIES];
> > -	int max = -1; /* index of measured_times with max/min values or not set */
> > +
> > +	/* index of measured_times with max/min values or not set */
> > +	int max = -1;
> >  	int min = -1;
> >  	int i;
> > 
> > -	if (read_current_timer(&pre_start) < 0 )
> > +	if (read_current_timer(&pre_start) < 0)
> >  		return 0;
> > 
> >  	/*
> > @@ -95,9 +97,7 @@ static unsigned long calibrate_delay_direct(void)
> >  		 * >= 12.5% apart, redo calibration.
> >  		 */
> >  		if (start >= post_end)
> > -			printk(KERN_NOTICE "calibrate_delay_direct() ignoring "
> > -					"timer_rate as we had a TSC wrap around"
> > -					" start=%lu >=post_end=%lu\n",
> > +			pr_notice("calibrate_delay_direct() ignoring timer_rate as we had a TSC wrap around start=%lu >=post_end=%lu\n",
> >  				start, post_end);
> >  		if (start < post_end && pre_start != 0 && pre_end != 0 &&
> >  		    (timer_rate_max - timer_rate_min) < (timer_rate_max >> 3)) {
> > @@ -134,14 +134,12 @@ static unsigned long calibrate_delay_direct(void)
> >  		good_timer_count = 0;
> >  		if ((measured_times[max] - estimate) <
> >  				(estimate - measured_times[min])) {
> > -			printk(KERN_NOTICE "calibrate_delay_direct() dropping "
> > -					"min bogoMips estimate %d = %lu\n",
> > +			pr_notice("calibrate_delay_direct() dropping min bogoMips estimate %d = %lu\n",
> >  				min, measured_times[min]);
> >  			measured_times[min] = 0;
> >  			min = max;
> >  		} else {
> > -			printk(KERN_NOTICE "calibrate_delay_direct() dropping "
> > -					"max bogoMips estimate %d = %lu\n",
> > +			pr_notice("calibrate_delay_direct() dropping max bogoMips estimate %d = %lu\n",
> >  				max, measured_times[max]);
> >  			measured_times[max] = 0;
> >  			max = min;
> > @@ -160,9 +158,8 @@ static unsigned long calibrate_delay_direct(void)
> > 
> >  	}
> > 
> > -	printk(KERN_NOTICE "calibrate_delay_direct() failed to get a good "
> > -	       "estimate for loops_per_jiffy.\nProbably due to long platform "
> > -		"interrupts. Consider using \"lpj=\" boot option.\n");
> > +	pr_notice("%s: failed to reasonably estimate loops_per_jiffy (long platform interrupts?) - perhaps use boot option 'lpj='\n",
> > +		  __func__);
> >  	return 0;
> >  }
> >  #else
> > @@ -280,23 +277,19 @@ void calibrate_delay(void)
> >  	if (per_cpu(cpu_loops_per_jiffy, this_cpu)) {
> >  		lpj = per_cpu(cpu_loops_per_jiffy, this_cpu);
> >  		if (!printed)
> > -			pr_info("Calibrating delay loop (skipped) "
> > -				"already calibrated this CPU");
> > +			pr_info("Calibrating delay loop (skipped) already calibrated this CPU");
> >  	} else if (preset_lpj) {
> >  		lpj = preset_lpj;
> >  		if (!printed)
> > -			pr_info("Calibrating delay loop (skipped) "
> > -				"preset value.. ");
> > +			pr_info("Calibrating delay loop (skipped) preset value.. ");
> >  	} else if ((!printed) && lpj_fine) {
> >  		lpj = lpj_fine;
> > -		pr_info("Calibrating delay loop (skipped), "
> > -			"value calculated using timer frequency.. ");
> > +		pr_info("Calibrating delay loop (skipped), value calculated using timer frequency.. ");
> >  	} else if ((lpj = calibrate_delay_is_known())) {
> >  		;
> >  	} else if ((lpj = calibrate_delay_direct()) != 0) {
> >  		if (!printed)
> > -			pr_info("Calibrating delay using timer "
> > -				"specific routine.. ");
> > +			pr_info("Calibrating delay using timer specific routine.. ");
> >  	} else {
> >  		if (!printed)
> >  			pr_info("Calibrating delay loop... ");



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

end of thread, other threads:[~2014-12-09  0:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-11 16:31 [PATCH] init: calibrate: fix style issues Rasmus Wriedt Larsen
2014-10-11 16:40 ` Joe Perches
2014-10-11 17:23   ` Rasmus Wriedt Larsen
2014-10-11 17:36     ` Joe Perches
2014-10-13 10:12       ` [PATCH v2] " Rasmus Wriedt Larsen
2014-12-08 20:56         ` Rasmus Wriedt Larsen
2014-12-09  0:24           ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).