Signed-off-by: Tomasz Nowicki tomasz.nowicki@linaro.org --- tools/bfapei/bfapei.c | 4 ++-- tools/cab/cab.c | 8 +++++--- tools/common/build_aml.c | 2 +- tools/common/check_aml.c | 10 +++++----- tools/common/include/build_aml.h | 2 +- tools/common/include/check_aml.h | 2 +- tools/mab/mab.c | 7 ++++--- 7 files changed, 19 insertions(+), 16 deletions(-)
diff --git a/tools/bfapei/bfapei.c b/tools/bfapei/bfapei.c index a410076..7b347e9 100644 --- a/tools/bfapei/bfapei.c +++ b/tools/bfapei/bfapei.c @@ -260,11 +260,11 @@ int main(int argc, char *argv[]) { }
/* Save buffer to specified file. */ - write_blob(homedir, apei_blob_name, buf, size); + write_blob(homedir, apei_blob_name, (unsigned char *)buf, size);
if (!quiet) { printf("%s blob for %s APEI table testing created\n", apei_blob_name, blob_type); - printf("Physical address: 0x%llx\n", paddr); + printf("Physical address: 0x%llx\n", (long long unsigned int)paddr); }
return BFAPEI_OK; diff --git a/tools/cab/cab.c b/tools/cab/cab.c index 481c021..1eb5649 100644 --- a/tools/cab/cab.c +++ b/tools/cab/cab.c @@ -78,7 +78,8 @@ int main(int argc, char *argv[]) printf("invalid physical address given\n"); return 1; } else { - printf("assume blob was relocated to 0x%llx\n", paddr); + printf("assume blob was relocated to 0x%llx\n", + (long long unsigned int)paddr); } } else { printf("? missing required physical address parameter\n"); @@ -114,8 +115,9 @@ int main(int argc, char *argv[]) ii = 0; LIST_FOREACH(np, &thead, tables) { printf( - "[%03d] %4s: %d bytes @ 0x%08x, loads @ 0x%016x\n", - ii, np->signature, np->len, np->offset, np->paddr); + "[%03d] %4s: %d bytes @ 0x%08x, loads @ 0x%016llx\n", + ii, np->signature, np->len, np->offset, + (long long unsigned int)np->paddr); ii++; } } diff --git a/tools/common/build_aml.c b/tools/common/build_aml.c index ebfcdc4..34cdfe4 100644 --- a/tools/common/build_aml.c +++ b/tools/common/build_aml.c @@ -89,7 +89,7 @@ struct table *build_table_entry(char *dir, char *buf) break; sig[n++] = buf[ii]; } - if (!valid_sig((unsigned char*)sig)) { + if (!valid_sig(sig)) { free(tmp); return NULL; } diff --git a/tools/common/check_aml.c b/tools/common/check_aml.c index ac47aa6..9e5b0c2 100644 --- a/tools/common/check_aml.c +++ b/tools/common/check_aml.c @@ -1,5 +1,5 @@ /* - * cab.c: helper functions for the tool to Check A Blob of ACPI tables + * check_aml.c: helper functions for the tool to Check A Blob of ACPI tables * * This file is subject to the terms and conditions of the GNU General * Public License. See the file "COPYING" in the main directory of this @@ -238,7 +238,7 @@ void find_all_tables(unsigned char *blob, int size, int base_addr) offset = (int)(p - blob);
while (offset + SIG_LENGTH < size) { - if (valid_sig(p)) { + if (valid_sig((char *)p)) { tp = check_table_entry(p); if (tp) { delta = TABLE_LEN_OFFSET; @@ -260,7 +260,7 @@ void find_all_tables(unsigned char *blob, int size, int base_addr) while (offset + SIG_LENGTH < size) { p++; offset++; - if (isalpha(*p) && valid_sig(p)) + if (isalpha(*p) && valid_sig((char *)p)) break; } } @@ -342,7 +342,7 @@ void check_xsdt_relocs(unsigned char *blob, int size, uint64_t paddr) for (ii = 0; ii < cnt; ii++, tpaddr++) { offset = (*tpaddr - paddr); res = FAIL; - if (valid_sig((unsigned char *)blob + offset)) { + if (valid_sig((char *)blob + offset)) { xp = find_table((char *)blob + offset); if (xp) { xp->ref_cnt++; @@ -505,7 +505,7 @@ int check_print_summary(void) printf("\nTotal tests: %d\n", passed + failed); printf("Passed: %d\n", passed); printf("Failed: %d\n", failed); - printf("Success rate: %0.1f%\n", + printf("Success rate: %0.1f%%\n", (100.0 * (float)passed) / (float)(passed + failed));
return failed; diff --git a/tools/common/include/build_aml.h b/tools/common/include/build_aml.h index 91334d7..ab86b78 100644 --- a/tools/common/include/build_aml.h +++ b/tools/common/include/build_aml.h @@ -1,5 +1,5 @@ /* - * mab.h: tool to Make A Blob of ACPI tables + * build_aml.h: helper functions for the tool to Make A Blob of ACPI tables * * This file is subject to the terms and conditions of the GNU General * Public License. See the file "COPYING" in the main directory of this diff --git a/tools/common/include/check_aml.h b/tools/common/include/check_aml.h index d44d68b..59e0c23 100644 --- a/tools/common/include/check_aml.h +++ b/tools/common/include/check_aml.h @@ -1,5 +1,5 @@ /* - * cab.h: tool to Check A Blob of ACPI tables + * check_aml.h: helper functions for the tool to Check A Blob of ACPI tables * * This file is subject to the terms and conditions of the GNU General * Public License. See the file "COPYING" in the main directory of this diff --git a/tools/mab/mab.c b/tools/mab/mab.c index 060ba72..cc99cb6 100644 --- a/tools/mab/mab.c +++ b/tools/mab/mab.c @@ -112,7 +112,8 @@ int main(int argc, char *argv[]) printf("invalid physical address given\n"); return 1; } else { - printf("relocating blob to 0x%llx\n", paddr); + printf("relocating blob to 0x%llx\n", + (long long unsigned int)paddr); } } else { printf("? missing required physical address parameter\n"); @@ -193,9 +194,9 @@ int main(int argc, char *argv[]) LIST_FOREACH(np, &thead, tables) { printf("[%03d] %4s : %s\n", ii, np->signature, basename(np->aml_name)); - printf(" %d bytes @ 0x%016x, reloc @ 0x%016x\n", + printf(" %d bytes @ 0x%016x, reloc @ 0x%016llx\n", np->file_size, np->offset, - np->offset + paddr); + (long long unsigned int)np->offset + paddr); ii++; } }