Patchwork cpu: cpufreq: use correct printf format specifiers

login
register
mail settings
Submitter Colin King
Date Jan. 9, 2014, 3:30 p.m.
Message ID <1389281429-25223-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/308861/
State Accepted
Headers show

Comments

Colin King - Jan. 9, 2014, 3:30 p.m.
From: Colin Ian King <colin.king@canonical.com>

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/cpu/cpufreq/cpufreq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Ivan Hu - Jan. 13, 2014, 3:22 a.m.
On 01/09/2014 11:30 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/cpu/cpufreq/cpufreq.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/cpu/cpufreq/cpufreq.c b/src/cpu/cpufreq/cpufreq.c
> index ae0986a..c2b9ef8 100644
> --- a/src/cpu/cpufreq/cpufreq.c
> +++ b/src/cpu/cpufreq/cpufreq.c
> @@ -199,11 +199,11 @@ static char *HzToHuman(const uint32_t hz)
>   			(Hz+50000.0) / 1000000);
>   		return buffer;
>   	} else if (Hz > 1000) {
> -		snprintf(buffer, sizeof(buffer), "%lli MHz",
> +		snprintf(buffer, sizeof(buffer), "%llu MHz",
>   			(Hz+500) / 1000);
>   		return buffer;
>   	} else {
> -		snprintf(buffer, sizeof(buffer), "%lli", Hz);
> +		snprintf(buffer, sizeof(buffer), "%llu", Hz);
>   		return buffer;
>   	}
>   }
>

Acked-by: Ivan Hu <ivan.hu@canonical.com>
Alex Hung - Jan. 14, 2014, 2:12 a.m.
On 01/09/2014 11:30 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/cpu/cpufreq/cpufreq.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/cpu/cpufreq/cpufreq.c b/src/cpu/cpufreq/cpufreq.c
> index ae0986a..c2b9ef8 100644
> --- a/src/cpu/cpufreq/cpufreq.c
> +++ b/src/cpu/cpufreq/cpufreq.c
> @@ -199,11 +199,11 @@ static char *HzToHuman(const uint32_t hz)
>  			(Hz+50000.0) / 1000000);
>  		return buffer;
>  	} else if (Hz > 1000) {
> -		snprintf(buffer, sizeof(buffer), "%lli MHz",
> +		snprintf(buffer, sizeof(buffer), "%llu MHz",
>  			(Hz+500) / 1000);
>  		return buffer;
>  	} else {
> -		snprintf(buffer, sizeof(buffer), "%lli", Hz);
> +		snprintf(buffer, sizeof(buffer), "%llu", Hz);
>  		return buffer;
>  	}
>  }
> 

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

Patch

diff --git a/src/cpu/cpufreq/cpufreq.c b/src/cpu/cpufreq/cpufreq.c
index ae0986a..c2b9ef8 100644
--- a/src/cpu/cpufreq/cpufreq.c
+++ b/src/cpu/cpufreq/cpufreq.c
@@ -199,11 +199,11 @@  static char *HzToHuman(const uint32_t hz)
 			(Hz+50000.0) / 1000000);
 		return buffer;
 	} else if (Hz > 1000) {
-		snprintf(buffer, sizeof(buffer), "%lli MHz",
+		snprintf(buffer, sizeof(buffer), "%llu MHz",
 			(Hz+500) / 1000);
 		return buffer;
 	} else {
-		snprintf(buffer, sizeof(buffer), "%lli", Hz);
+		snprintf(buffer, sizeof(buffer), "%llu", Hz);
 		return buffer;
 	}
 }