[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Minios-devel] [PATCH v3 14/43] arm64: time.c: fix the wrong format for printk
- To: Huang Shijie <shijie.huang@xxxxxxx>, wei.liu2@xxxxxxxxxx
- From: Julien Grall <julien.grall@xxxxxxx>
- Date: Wed, 18 Apr 2018 21:29:12 +0100
- Authentication-results: outbound.protection.outlook.com; spf=skipped (originating message); dkim=none (message not signed) header.d=none; dmarc=none action=none header.from=arm.com;
- Cc: jgross@xxxxxxxx, wei.chen@xxxxxxx, steve.capper@xxxxxxx, vlad.babchuk@xxxxxxxxx, minios-devel@xxxxxxxxxxxxxxxxxxxx, kaly.xin@xxxxxxx, samuel.thibault@xxxxxxxxxxxx, baozich@xxxxxxxxx, nd@xxxxxxx
- Delivery-date: Wed, 18 Apr 2018 20:29:38 +0000
- List-id: Mini-os development list <minios-devel.lists.xenproject.org>
- Nodisclaimer: True
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On 16/04/2018 07:31, Huang Shijie wrote:
We will meet the compiler error for the current code:
--------------------------------------------------
time.c: In function ‘init_time’:
time.c:131:12: error: format ‘%llx’ expects argument of
type ‘long long unsigned int’, but argument 2 has
type ‘uint64_t {aka long unsigned int}’ [-Werror=format=]
printk("Virtual Count register is %llx, freq = %d Hz\n", cntvct_at_init,
counter_freq);
^
cc1: all warnings being treated as errors
--------------------------------------------------
This patch fixes the compiling error.
Signed-off-by: Huang Shijie <shijie.huang@xxxxxxx>
---
arch/arm/time.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm/time.c b/arch/arm/time.c
index a088981..8d68cf0 100644
--- a/arch/arm/time.c
+++ b/arch/arm/time.c
@@ -5,6 +5,7 @@
#include <mini-os/types.h>
#include <mini-os/time.h>
#include <mini-os/lib.h>
+#include <inttypes.h>
Where does the include "inttypes.h" come from?
//#define VTIMER_DEBUG
#ifdef VTIMER_DEBUG
@@ -128,7 +129,8 @@ void init_time(void)
__asm__ __volatile__("mrc p15, 0, %0, c14, c0, 0":"=r"(counter_freq));
cntvct_at_init = read_virtual_count();
- printk("Virtual Count register is %llx, freq = %d Hz\n", cntvct_at_init,
counter_freq);
+ printk("Virtual Count register is %"PRIX64", freq = %d Hz\n",
+ cntvct_at_init, counter_freq);
}
void fini_time(void)
--
Julien Grall
_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel
|