From patchwork Sun Oct 14 20:32:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 191404 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 091222C009B for ; Mon, 15 Oct 2012 07:32:32 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TNUrO-0006C3-RX; Sun, 14 Oct 2012 20:32:30 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TNUrK-00069y-Eo for fwts-devel@lists.ubuntu.com; Sun, 14 Oct 2012 20:32:26 +0000 Received: from cpc3-craw6-2-0-cust180.croy.cable.virginmedia.com ([77.100.248.181] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1TNUrK-0003rl-Bv for fwts-devel@lists.ubuntu.com; Sun, 14 Oct 2012 20:32:26 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH 14/26] acpi: mcfg: make mcfg_size a ssize_t Date: Sun, 14 Oct 2012 21:32:06 +0100 Message-Id: <1350246738-31699-15-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1350246738-31699-1-git-send-email-colin.king@canonical.com> References: <1350246738-31699-1-git-send-email-colin.king@canonical.com> X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: fwts-devel-bounces@lists.ubuntu.com Errors-To: fwts-devel-bounces@lists.ubuntu.com From: Colin Ian King Make mcfg_size a ssize_t and use appropriate printf format specifiers for this. Signed-off-by: Colin Ian King Acked-by: Alex Hung Acked-by: Keng-Yu Lin --- src/acpi/mcfg/mcfg.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/acpi/mcfg/mcfg.c b/src/acpi/mcfg/mcfg.c index f4cd53c..1655d3b 100644 --- a/src/acpi/mcfg/mcfg.c +++ b/src/acpi/mcfg/mcfg.c @@ -118,7 +118,7 @@ static int mcfg_test1(fwts_framework *fw) void *mapped_table_page; struct mcfg_entry *table, firstentry; int failed = 0; - int mcfg_size; + ssize_t mcfg_size; const char *memory_map_name; int page_size; @@ -148,9 +148,9 @@ static int mcfg_test1(fwts_framework *fw) mcfg_size -= 36; /* general ACPI header */ mcfg_size -= 8; /* 8 bytes of padding */ - if ((int)mcfg_size<0) { + if (mcfg_size < 0) { fwts_failed(fw, LOG_LEVEL_HIGH, "MCFGInvalidSize", - "Invalid MCFG ACPI table size: got %d bytes expecting more", + "Invalid MCFG ACPI table size: got %zd bytes expecting more", mcfg_size + 36 + 8); fwts_tag_failed(fw, FWTS_TAG_ACPI_INVALID_TABLE); fwts_advice(fw, @@ -167,14 +167,14 @@ static int mcfg_test1(fwts_framework *fw) return FWTS_ERROR; } - if ((nr * sizeof(struct mcfg_entry)) != mcfg_size) { + if (mcfg_size != (ssize_t)(nr * sizeof(struct mcfg_entry))) { fwts_failed(fw, LOG_LEVEL_HIGH, "MCFGInvalidSize2", "MCFG table is not a multiple of record size"); fwts_tag_failed(fw, FWTS_TAG_ACPI_INVALID_TABLE); return FWTS_ERROR; } - fwts_log_info(fw, "MCFG table found, size is %i bytes (excluding header) (%i entries).", + fwts_log_info(fw, "MCFG table found, size is %zd bytes (excluding header) (%i entries).", mcfg_size, nr); table_page = table_ptr = (const uint8_t *)mcfg_table->data;