[PATCH 06/18] acpi: s3power: print format using inttypes
IvanHu
ivan.hu at canonical.com
Tue Oct 2 02:25:11 UTC 2012
On 09/24/2012 03:03 AM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/acpi/s3power/s3power.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/acpi/s3power/s3power.c b/src/acpi/s3power/s3power.c
> index e5c4ba0..a57bcba 100644
> --- a/src/acpi/s3power/s3power.c
> +++ b/src/acpi/s3power/s3power.c
> @@ -28,6 +28,7 @@
> #include <sys/stat.h>
> #include <unistd.h>
> #include <time.h>
> +#include <inttypes.h>
>
> #define PM_SUSPEND "pm-suspend"
>
> @@ -122,7 +123,7 @@ static void s3power_difference(fwts_framework *fw,
> float hourly_loss;
>
> if (before != 0) {
> - fwts_log_info(fw, "Change in capacity: %d %s\n", (int)diff, units);
> + fwts_log_info(fw, "Change in capacity: %" PRId32 " %s\n", diff, units);
> hourly_loss = ((float)diff * 3600.0) / (float)s3power_sleep_delay;
> if (diff < 0) {
> fwts_log_error(fw, "Negative loss of power, are you sure the machine was not charging?");
> @@ -130,7 +131,7 @@ static void s3power_difference(fwts_framework *fw,
> fwts_log_info(fw, "Loss of %7.4f %s per hour.", hourly_loss, units);
> if ((diff > 0) && (battery_capacity > 0)) {
> float duration = (float)battery_capacity / hourly_loss;
> - fwts_log_info(fw, "The %d %s battery will provide %5.2f hours of suspend time.",
> + fwts_log_info(fw, "The %" PRIu32 " %s battery will provide %5.2f hours of suspend time.",
> battery_capacity, units, duration);
>
> if (duration < 24.0) {
>
Acked-by: Ivan Hu <ivan.hu at canonical.com>
More information about the fwts-devel
mailing list