Patchwork cpu: cpufreq: fix a bunch of 32 bit build errors

login
register
mail settings
Submitter Colin King
Date Jan. 4, 2013, 11:31 a.m.
Message ID <1357299068-29883-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/209445/
State Accepted
Headers show

Comments

Colin King - Jan. 4, 2013, 11:31 a.m.
From: Colin Ian King <colin.king@canonical.com>

The recent changes I made to the cpufreq break the 32 bit build, this
patch fixes these errors.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/cpu/cpufreq/cpufreq.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
Keng-Yu Lin - Jan. 9, 2013, 9:19 a.m.
On Fri, Jan 4, 2013 at 7:31 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The recent changes I made to the cpufreq break the 32 bit build, this
> patch fixes these errors.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/cpu/cpufreq/cpufreq.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/src/cpu/cpufreq/cpufreq.c b/src/cpu/cpufreq/cpufreq.c
> index 1544b42..94f2060 100644
> --- a/src/cpu/cpufreq/cpufreq.c
> +++ b/src/cpu/cpufreq/cpufreq.c
> @@ -284,7 +284,7 @@ static void do_cpu(fwts_framework *fw, int cpu)
>         fwts_log_info_verbatum(fw, " Frequency | Relative Speed | Bogo loops");
>         fwts_log_info_verbatum(fw, "-----------+----------------+-----------");
>         for (i = 0; i < speedcount; i++)
> -               fwts_log_info_verbatum(fw, "%9s |     %5.1f %%    | %9lu",
> +               fwts_log_info_verbatum(fw, "%9s |     %5.1f %%    | %9" PRIu64,
>                         HzToHuman(freqs[i].Hz),
>                         100.0 * freqs[i].speed/cpu_top_speed,
>                         freqs[i].speed);
> @@ -327,7 +327,9 @@ static void do_cpu(fwts_framework *fw, int cpu)
>                 if (freqs[i].speed > freqs[i+1].speed)
>                         fwts_failed(fw, LOG_LEVEL_MEDIUM,
>                                 "CPUFreqSlowerOnCPU",
> -                               "Supposedly higher frequency %s is slower (%lu bogo loops) than frequency %s (%lu bogo loops) on CPU %i.",
> +                               "Supposedly higher frequency %s is slower (%" PRIu64
> +                               " bogo loops) than frequency %s (%" PRIu64
> +                               " bogo loops) on CPU %i.",
>                                 HzToHuman(freqs[i+1].Hz), freqs[i+1].speed,
>                                 HzToHuman(freqs[i].Hz), freqs[i].speed,
>                                 cpu);
> @@ -470,7 +472,7 @@ static void do_sw_any_test(fwts_framework *fw)
>  {
>         DIR *dir;
>         struct dirent *entry;
> -       unsigned long highperf, lowperf;
> +       uint64_t highperf, lowperf;
>         int first_cpu_index = -1;
>         int cpu;
>
> --
> 1.8.0
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Alex Hung - Jan. 14, 2013, 6:58 a.m.
On 01/04/2013 07:31 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The recent changes I made to the cpufreq break the 32 bit build, this
> patch fixes these errors.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/cpu/cpufreq/cpufreq.c | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/src/cpu/cpufreq/cpufreq.c b/src/cpu/cpufreq/cpufreq.c
> index 1544b42..94f2060 100644
> --- a/src/cpu/cpufreq/cpufreq.c
> +++ b/src/cpu/cpufreq/cpufreq.c
> @@ -284,7 +284,7 @@ static void do_cpu(fwts_framework *fw, int cpu)
>   	fwts_log_info_verbatum(fw, " Frequency | Relative Speed | Bogo loops");
>   	fwts_log_info_verbatum(fw, "-----------+----------------+-----------");
>   	for (i = 0; i < speedcount; i++)
> -		fwts_log_info_verbatum(fw, "%9s |     %5.1f %%    | %9lu",
> +		fwts_log_info_verbatum(fw, "%9s |     %5.1f %%    | %9" PRIu64,
>   			HzToHuman(freqs[i].Hz),
>   			100.0 * freqs[i].speed/cpu_top_speed,
>   			freqs[i].speed);
> @@ -327,7 +327,9 @@ static void do_cpu(fwts_framework *fw, int cpu)
>   		if (freqs[i].speed > freqs[i+1].speed)
>   			fwts_failed(fw, LOG_LEVEL_MEDIUM,
>   				"CPUFreqSlowerOnCPU",
> -				"Supposedly higher frequency %s is slower (%lu bogo loops) than frequency %s (%lu bogo loops) on CPU %i.",
> +				"Supposedly higher frequency %s is slower (%" PRIu64
> +				" bogo loops) than frequency %s (%" PRIu64
> +				" bogo loops) on CPU %i.",
>   				HzToHuman(freqs[i+1].Hz), freqs[i+1].speed,
>   				HzToHuman(freqs[i].Hz), freqs[i].speed,
>   				cpu);
> @@ -470,7 +472,7 @@ static void do_sw_any_test(fwts_framework *fw)
>   {
>   	DIR *dir;
>   	struct dirent *entry;
> -	unsigned long highperf, lowperf;
> +	uint64_t highperf, lowperf;
>   	int first_cpu_index = -1;
>   	int cpu;
>
>

Acked-by: Alex Hung <alex.hung@canonical.com>

Patch

diff --git a/src/cpu/cpufreq/cpufreq.c b/src/cpu/cpufreq/cpufreq.c
index 1544b42..94f2060 100644
--- a/src/cpu/cpufreq/cpufreq.c
+++ b/src/cpu/cpufreq/cpufreq.c
@@ -284,7 +284,7 @@  static void do_cpu(fwts_framework *fw, int cpu)
 	fwts_log_info_verbatum(fw, " Frequency | Relative Speed | Bogo loops");
 	fwts_log_info_verbatum(fw, "-----------+----------------+-----------");
 	for (i = 0; i < speedcount; i++)
-		fwts_log_info_verbatum(fw, "%9s |     %5.1f %%    | %9lu",
+		fwts_log_info_verbatum(fw, "%9s |     %5.1f %%    | %9" PRIu64,
 			HzToHuman(freqs[i].Hz),
 			100.0 * freqs[i].speed/cpu_top_speed,
 			freqs[i].speed);
@@ -327,7 +327,9 @@  static void do_cpu(fwts_framework *fw, int cpu)
 		if (freqs[i].speed > freqs[i+1].speed)
 			fwts_failed(fw, LOG_LEVEL_MEDIUM,
 				"CPUFreqSlowerOnCPU",
-				"Supposedly higher frequency %s is slower (%lu bogo loops) than frequency %s (%lu bogo loops) on CPU %i.",
+				"Supposedly higher frequency %s is slower (%" PRIu64
+				" bogo loops) than frequency %s (%" PRIu64 
+				" bogo loops) on CPU %i.",
 				HzToHuman(freqs[i+1].Hz), freqs[i+1].speed,
 				HzToHuman(freqs[i].Hz), freqs[i].speed,
 				cpu);
@@ -470,7 +472,7 @@  static void do_sw_any_test(fwts_framework *fw)
 {
 	DIR *dir;
 	struct dirent *entry;
-	unsigned long highperf, lowperf;
+	uint64_t highperf, lowperf;
 	int first_cpu_index = -1;
 	int cpu;