From 6311f63de02ee04d93016242977ade4727089de8 Mon Sep 17 00:00:00 2001 From: Varun Wadekar Date: Wed, 7 Jun 2017 09:57:42 -0700 Subject: Tegra: enable 'signed-comparison' compilation warning/errors This patch enables the 'sign-compare' flag, to enable warning/errors for comparisons between signed/unsigned variables. The warning has been enabled for all the Tegra platforms, to start with. Signed-off-by: Varun Wadekar --- lib/cpus/errata_report.c | 2 +- lib/psci/psci_common.c | 4 ++-- lib/psci/psci_main.c | 2 +- lib/psci/psci_off.c | 2 +- lib/xlat_tables_v2/xlat_tables_internal.c | 14 +++++++------- lib/xlat_tables_v2/xlat_tables_private.h | 12 ++++++------ 6 files changed, 18 insertions(+), 18 deletions(-) (limited to 'lib') diff --git a/lib/cpus/errata_report.c b/lib/cpus/errata_report.c index 4d9757e0..1e1fc786 100644 --- a/lib/cpus/errata_report.c +++ b/lib/cpus/errata_report.c @@ -60,7 +60,7 @@ int errata_needs_reporting(spinlock_t *lock, uint32_t *reported) * Applied: INFO * Not applied: VERBOSE */ -void errata_print_msg(int status, const char *cpu, const char *id) +void errata_print_msg(unsigned int status, const char *cpu, const char *id) { /* Errata status strings */ static const char *const errata_status_str[] = { diff --git a/lib/psci/psci_common.c b/lib/psci/psci_common.c index 763de046..f31b3238 100644 --- a/lib/psci/psci_common.c +++ b/lib/psci/psci_common.c @@ -332,7 +332,7 @@ void psci_get_parent_pwr_domain_nodes(unsigned int cpu_idx, unsigned int node_index[]) { unsigned int parent_node = psci_cpu_pd_nodes[cpu_idx].parent_node; - int i; + unsigned int i; for (i = PSCI_CPU_PWR_LVL + 1; i <= end_lvl; i++) { *node_index++ = parent_node; @@ -901,7 +901,7 @@ void psci_print_power_domain_map(void) *****************************************************************************/ int psci_secondaries_brought_up(void) { - int idx, n_valid = 0; + unsigned int idx, n_valid = 0; for (idx = 0; idx < ARRAY_SIZE(psci_cpu_pd_nodes); idx++) { if (psci_cpu_pd_nodes[idx].mpidr != PSCI_INVALID_MPIDR) diff --git a/lib/psci/psci_main.c b/lib/psci/psci_main.c index 2a6644b6..257479aa 100644 --- a/lib/psci/psci_main.c +++ b/lib/psci/psci_main.c @@ -209,7 +209,7 @@ int psci_cpu_off(void) int psci_affinity_info(u_register_t target_affinity, unsigned int lowest_affinity_level) { - unsigned int target_idx; + int target_idx; /* We dont support level higher than PSCI_CPU_PWR_LVL */ if (lowest_affinity_level > PSCI_CPU_PWR_LVL) diff --git a/lib/psci/psci_off.c b/lib/psci/psci_off.c index 8be44c31..e7fb6532 100644 --- a/lib/psci/psci_off.c +++ b/lib/psci/psci_off.c @@ -19,7 +19,7 @@ ******************************************************************************/ static void psci_set_power_off_state(psci_power_state_t *state_info) { - int lvl; + unsigned int lvl; for (lvl = PSCI_CPU_PWR_LVL; lvl <= PLAT_MAX_PWR_LVL; lvl++) state_info->pwr_domain_state[lvl] = PLAT_MAX_OFF_STATE; diff --git a/lib/xlat_tables_v2/xlat_tables_internal.c b/lib/xlat_tables_v2/xlat_tables_internal.c index 2d556e65..e1a252be 100644 --- a/lib/xlat_tables_v2/xlat_tables_internal.c +++ b/lib/xlat_tables_v2/xlat_tables_internal.c @@ -37,7 +37,7 @@ */ static int xlat_table_get_index(xlat_ctx_t *ctx, const uint64_t *table) { - for (int i = 0; i < ctx->tables_num; i++) + for (unsigned int i = 0; i < ctx->tables_num; i++) if (ctx->tables[i] == table) return i; @@ -53,7 +53,7 @@ static int xlat_table_get_index(xlat_ctx_t *ctx, const uint64_t *table) /* Returns a pointer to an empty translation table. */ static uint64_t *xlat_table_get_empty(xlat_ctx_t *ctx) { - for (int i = 0; i < ctx->tables_num; i++) + for (unsigned int i = 0; i < ctx->tables_num; i++) if (ctx->tables_mapped_regions[i] == 0) return ctx->tables[i]; @@ -203,7 +203,7 @@ static void xlat_tables_unmap_region(xlat_ctx_t *ctx, mmap_region_t *mm, const uintptr_t table_base_va, uint64_t *const table_base, const int table_entries, - const int level) + const unsigned int level) { assert(level >= ctx->base_level && level <= XLAT_TABLE_LEVEL_MAX); @@ -468,7 +468,7 @@ static uintptr_t xlat_tables_map_region(xlat_ctx_t *ctx, mmap_region_t *mm, const uintptr_t table_base_va, uint64_t *const table_base, const int table_entries, - const int level) + const unsigned int level) { assert(level >= ctx->base_level && level <= XLAT_TABLE_LEVEL_MAX); @@ -1053,14 +1053,14 @@ void init_xlation_table(xlat_ctx_t *ctx) /* All tables must be zeroed before mapping any region. */ - for (int i = 0; i < ctx->base_table_entries; i++) + for (unsigned int i = 0; i < ctx->base_table_entries; i++) ctx->base_table[i] = INVALID_DESC; - for (int j = 0; j < ctx->tables_num; j++) { + for (unsigned int j = 0; j < ctx->tables_num; j++) { #if PLAT_XLAT_TABLES_DYNAMIC ctx->tables_mapped_regions[j] = 0; #endif - for (int i = 0; i < XLAT_TABLE_ENTRIES; i++) + for (unsigned int i = 0; i < XLAT_TABLE_ENTRIES; i++) ctx->tables[j][i] = INVALID_DESC; } diff --git a/lib/xlat_tables_v2/xlat_tables_private.h b/lib/xlat_tables_v2/xlat_tables_private.h index 7b3e555e..83e0b6ea 100644 --- a/lib/xlat_tables_v2/xlat_tables_private.h +++ b/lib/xlat_tables_v2/xlat_tables_private.h @@ -52,7 +52,7 @@ typedef struct { * null entry. */ mmap_region_t *mmap; - int mmap_num; + unsigned int mmap_num; /* * Array of finer-grain translation tables. @@ -60,7 +60,7 @@ typedef struct { * contain both level-2 and level-3 entries. */ uint64_t (*tables)[XLAT_TABLE_ENTRIES]; - int tables_num; + unsigned int tables_num; /* * Keep track of how many regions are mapped in each table. The base * table can't be unmapped so it isn't needed to keep track of it. @@ -69,14 +69,14 @@ typedef struct { int *tables_mapped_regions; #endif /* PLAT_XLAT_TABLES_DYNAMIC */ - int next_table; + unsigned int next_table; /* * Base translation table. It doesn't need to have the same amount of * entries as the ones used for other levels. */ uint64_t *base_table; - int base_table_entries; + unsigned int base_table_entries; /* * Max Physical and Virtual addresses currently in use by the @@ -87,10 +87,10 @@ typedef struct { uintptr_t max_va; /* Level of the base translation table. */ - int base_level; + unsigned int base_level; /* Set to 1 when the translation tables are initialized. */ - int initialized; + unsigned int initialized; /* * Bit mask that has to be ORed to the rest of a translation table -- cgit v1.2.3