From 695b2966813476ca89864c86503384afa557b9a5 Mon Sep 17 00:00:00 2001 From: ligd Date: Tue, 21 Jun 2022 10:44:26 +0800 Subject: [PATCH] pm: fix build warning power/pm_procfs.c:282:27: warning: format specifies type 'unsigned long' but the argument has type 'time_t' (aka 'unsigned int') [-Wformat] dom->wake[state].tv_sec, ^~~~~~~~~~~~~~~~~~~~~~~ make[2]: Entering directory '/home/ligd/platform/m2/audio/frameworks/media' power/pm_procfs.c:283:27: warning: format specifies type 'unsigned long' but the argument has type 'unsigned int' [-Wformat] 100 * dom->wake[state].tv_sec / sum, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ power/pm_procfs.c:284:27: warning: format specifies type 'unsigned long' but the argument has type 'time_t' (aka 'unsigned int') [-Wformat] dom->sleep[state].tv_sec, ^~~~~~~~~~~~~~~~~~~~~~~~ power/pm_procfs.c:285:27: warning: format specifies type 'unsigned long' but the argument has type 'unsigned int' [-Wformat] 100 * dom->sleep[state].tv_sec / sum, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ power/pm_procfs.c:286:27: warning: format specifies type 'unsigned long' but the argument has type 'time_t' (aka 'unsigned int') [-Wformat] total.tv_sec, ^~~~~~~~~~~~ power/pm_procfs.c:287:27: warning: format specifies type 'unsigned long' but the argument has type 'unsigned int' [-Wformat] 100 * total.tv_sec / sum); ^~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: ligd --- drivers/power/pm_procfs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/power/pm_procfs.c b/drivers/power/pm_procfs.c index 2f862d40d3..0760c47af8 100644 --- a/drivers/power/pm_procfs.c +++ b/drivers/power/pm_procfs.c @@ -45,10 +45,11 @@ ****************************************************************************/ #define STHDR "DOMAIN%d WAKE SLEEP TOTAL\n" -#define STFMT "%-8s %8lus %02lu%% %8lus %02lu%% %8lus %02lu%%\n" +#define STFMT "%-8s %8" PRIu32 "s %02" PRIu32 "%% %8" PRIu32 "s %02" \ + PRIu32 "%% %8" PRIu32 "s %02" PRIu32 "%%\n" #define WAHDR "DOMAIN%d STATE COUNT TIME\n" -#define WAFMT "%-12s %-10s %4lu %8lus\n" +#define WAFMT "%-12s %-10s %4" PRIu32 " %8" PRIu32 "s\n" /* Determines the size of an intermediate buffer that must be large enough * to handle the longest line generated by this logic (plus a couple of