From patchwork Fri Mar 2 11:28:07 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: 144221 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 AC9721007D6 for ; Fri, 2 Mar 2012 22:28:12 +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 1S3Qeg-0001t7-NJ for incoming@patchwork.ozlabs.org; Fri, 02 Mar 2012 11:28:10 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1S3Qef-0001sn-FP for fwts-devel@lists.ubuntu.com; Fri, 02 Mar 2012 11:28:09 +0000 Received: from cpc19-craw6-2-0-cust5.croy.cable.virginmedia.com ([77.102.228.6] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1S3Qef-0000bI-70 for fwts-devel@lists.ubuntu.com; Fri, 02 Mar 2012 11:28:09 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH 1/2] hpet: hpet_check: ensure source fits into 80 columns Date: Fri, 2 Mar 2012 11:28:07 +0000 Message-Id: <1330687688-30180-2-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.7.9 In-Reply-To: <1330687688-30180-1-git-send-email-colin.king@canonical.com> References: <1330687688-30180-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 Signed-off-by: Colin Ian King Acked-by: Keng-Yu Lin Acked-by: Alex Hung --- src/hpet/hpet_check/hpet_check.c | 62 +++++++++++++++++++++++++------------- 1 files changed, 41 insertions(+), 21 deletions(-) diff --git a/src/hpet/hpet_check/hpet_check.c b/src/hpet/hpet_check/hpet_check.c index 447049a..79dfae9 100644 --- a/src/hpet/hpet_check/hpet_check.c +++ b/src/hpet/hpet_check/hpet_check.c @@ -55,7 +55,8 @@ static void check_hpet_base_hpet(void) } #endif -static void hpet_parse_check_base(fwts_framework *fw, char *table, fwts_list_link *item) +static void hpet_parse_check_base(fwts_framework *fw, + char *table, fwts_list_link *item) { char *val, *idx; @@ -69,34 +70,42 @@ static void hpet_parse_check_base(fwts_framework *fw, char *table, fwts_list_lin if (hpet_base_p != 0) { if (hpet_base_p != address_base) - fwts_failed(fw, LOG_LEVEL_MEDIUM, "HPETBaseMismatch", - "Mismatched HPET base between %s (%lx) and the kernel (%lx).", + fwts_failed(fw, LOG_LEVEL_MEDIUM, + "HPETBaseMismatch", + "Mismatched HPET base between %s (%lx) " + "and the kernel (%lx).", table, - (unsigned long)hpet_base_p, (unsigned long)address_base); + (unsigned long)hpet_base_p, + (unsigned long)address_base); else fwts_passed(fw, - "HPET base matches that between %s and the kernel (%lx).", + "HPET base matches that between %s and " + "the kernel (%lx).", table, (unsigned long)hpet_base_p); } } } -static void hpet_parse_device_hpet(fwts_framework *fw, char *table, fwts_list_link *item) +static void hpet_parse_device_hpet(fwts_framework *fw, + char *table, fwts_list_link *item) { for (;item != NULL; item = item->next) { - if ((strstr(fwts_text_list_text(item), "Name") != NULL) && - (strstr(fwts_text_list_text(item), "ResourceTemplate") != NULL)) { + char *str = fwts_text_list_text(item); + if ((strstr(str, "Name") != NULL) && + (strstr(str, "ResourceTemplate") != NULL)) { fwts_list_link *tmp_item = item->next; for (; tmp_item != NULL; tmp_item = tmp_item->next) { - if (strstr(fwts_text_list_text(tmp_item), "Memory32Fixed") != NULL) { + if (strstr(fwts_text_list_text(tmp_item), + "Memory32Fixed") != NULL) { tmp_item = tmp_item->next; if (tmp_item != NULL) { hpet_parse_check_base(fw, table, tmp_item); return; } } - if (strstr(fwts_text_list_text(tmp_item), "DWordMemory") != NULL) { + if (strstr(fwts_text_list_text(tmp_item), + "DWordMemory") != NULL) { tmp_item = tmp_item->next; if (tmp_item != NULL) { tmp_item = tmp_item->next; @@ -112,10 +121,13 @@ static void hpet_parse_device_hpet(fwts_framework *fw, char *table, fwts_list_li } } -/* check_hpet_base_dsdt() -- used to parse the DSDT for HPET base info */ -static void hpet_check_base_acpi_table(fwts_framework *fw, char *table, int which) +/* + * check_hpet_base_dsdt() + * used to parse the DSDT for HPET base info + */ +static void hpet_check_base_acpi_table(fwts_framework *fw, + char *table, int which) { - fwts_list *output; fwts_list_link *item; @@ -157,9 +169,10 @@ static int hpet_check_test1(fwts_framework *fw) fwts_list_link *item; fwts_log_info(fw, - "This test checks the HPET PCI BAR for each timer block in the timer. " - "The base address is passed by the firmware via an ACPI table. " - "IRQ routing and initialization is also verified by the test."); + "This test checks the HPET PCI BAR for each timer block " + "in the timer. The base address is passed by the firmware " + "via an ACPI table. IRQ routing and initialization is also " + "verified by the test."); fwts_list_foreach(item, klog) { char *text = fwts_text_list_text(item); @@ -168,7 +181,9 @@ static int hpet_check_test1(fwts_framework *fw) char *str = strstr(text, "base: "); if (str) { hpet_base_p = strtoul(str+6, NULL, 0x10); - fwts_passed(fw, "Found HPET base %x in kernel log.", (uint32_t)hpet_base_p); + fwts_passed(fw, + "Found HPET base %x in kernel log.", + (uint32_t)hpet_base_p); break; } } @@ -179,7 +194,9 @@ static int hpet_check_test1(fwts_framework *fw) char *str = strstr(text, "at MMIO "); if (str) { hpet_base_p = strtoul(str+8, NULL, 0x10); - fwts_passed(fw, "Found HPET base %x in kernel log.", (uint32_t)hpet_base_p); + fwts_passed(fw, + "Found HPET base %x in kernel log.", + (uint32_t)hpet_base_p); break; } } @@ -215,14 +232,16 @@ static int hpet_check_test2(fwts_framework *fw) if (vendor_id == 0xffff) fwts_failed(fw, LOG_LEVEL_MEDIUM, "HPETVendorId", - "Invalid Vendor ID: %04x - this should be configured.", vendor_id); + "Invalid Vendor ID: %04x - this should be configured.", + vendor_id); else fwts_passed(fw, "Vendor ID looks sane: %04x.", vendor_id); clk_period = hpet_id >> 32; if ((clk_period > MAX_CLK_PERIOD) || (clk_period == 0)) fwts_failed(fw, LOG_LEVEL_MEDIUM, "HPETClockPeriod", - "Invalid clock period %u, must be non-zero and less than 10^8.", clk_period); + "Invalid clock period %u, must be non-zero and " + "less than 10^8.", clk_period); else fwts_passed(fw, "Valid clock period %u.", clk_period); @@ -256,6 +275,7 @@ static fwts_framework_ops hpet_check_ops = { .minor_tests = hpet_check_tests }; -FWTS_REGISTER(hpet_check, &hpet_check_ops, FWTS_TEST_ANYTIME, FWTS_BATCH | FWTS_ROOT_PRIV); +FWTS_REGISTER(hpet_check, &hpet_check_ops, FWTS_TEST_ANYTIME, + FWTS_BATCH | FWTS_ROOT_PRIV); #endif