diff options
author | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2018-11-13 13:27:41 +0000 |
---|---|---|
committer | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2018-11-13 13:29:03 +0000 |
commit | a6febeab812269d68ac4dae3e0e6c2adb88fb2aa (patch) | |
tree | 60825a1074f1e3c72af7f7ca7bfb381d2fac438d /drivers | |
parent | 9793e0356e47902d21117b1a1ac64538deeb8f85 (diff) | |
parent | 7227d89215d29992a9999cb8af5fa36f99eeb5c2 (diff) | |
download | platform_external_arm-trusted-firmware-a6febeab812269d68ac4dae3e0e6c2adb88fb2aa.tar.gz platform_external_arm-trusted-firmware-a6febeab812269d68ac4dae3e0e6c2adb88fb2aa.tar.bz2 platform_external_arm-trusted-firmware-a6febeab812269d68ac4dae3e0e6c2adb88fb2aa.zip |
Merge pull request #1676 from Yann-lms/static_analysis
Correct some issues found with static analysis tools
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/partition/gpt.c | 10 | ||||
-rw-r--r-- | drivers/st/clk/stm32mp1_clk.c | 4 | ||||
-rw-r--r-- | drivers/st/clk/stm32mp1_clkfunc.c | 6 |
3 files changed, 12 insertions, 8 deletions
diff --git a/drivers/partition/gpt.c b/drivers/partition/gpt.c index 9cc917d33..0c51e62a8 100644 --- a/drivers/partition/gpt.c +++ b/drivers/partition/gpt.c @@ -13,10 +13,14 @@ static int unicode_to_ascii(unsigned short *str_in, unsigned char *str_out) { - uint8_t *name = (uint8_t *)str_in; + uint8_t *name; int i; - assert((str_in != NULL) && (str_out != NULL) && (name[0] != '\0')); + assert((str_in != NULL) && (str_out != NULL)); + + name = (uint8_t *)str_in; + + assert(name[0] != '\0'); /* check whether the unicode string is valid */ for (i = 1; i < (EFI_NAMELEN << 1); i += 2) { @@ -36,7 +40,7 @@ int parse_gpt_entry(gpt_entry_t *gpt_entry, partition_entry_t *entry) { int result; - assert((gpt_entry != 0) && (entry != 0)); + assert((gpt_entry != NULL) && (entry != NULL)); if ((gpt_entry->first_lba == 0) && (gpt_entry->last_lba == 0)) { return -EINVAL; diff --git a/drivers/st/clk/stm32mp1_clk.c b/drivers/st/clk/stm32mp1_clk.c index f0bf363e2..b8457cb37 100644 --- a/drivers/st/clk/stm32mp1_clk.c +++ b/drivers/st/clk/stm32mp1_clk.c @@ -1323,7 +1323,7 @@ int stm32mp1_clk_init(void) int ret, len; enum stm32mp1_pll_id i; bool lse_css = false; - const uint32_t *pkcs_cell; + const fdt32_t *pkcs_cell; /* Check status field to disable security */ if (!fdt_get_rcc_secure_status()) { @@ -1529,7 +1529,7 @@ int stm32mp1_clk_init(void) priv->pkcs_usb_value = 0; for (j = 0; j < ((uint32_t)len / sizeof(uint32_t)); j++) { - uint32_t pkcs = (uint32_t)fdt32_to_cpu(pkcs_cell[j]); + uint32_t pkcs = fdt32_to_cpu(pkcs_cell[j]); if (pkcs == (uint32_t)CLK_CKPER_DISABLED) { ckper_disabled = true; diff --git a/drivers/st/clk/stm32mp1_clkfunc.c b/drivers/st/clk/stm32mp1_clkfunc.c index d4c69cb4e..078d803e7 100644 --- a/drivers/st/clk/stm32mp1_clkfunc.c +++ b/drivers/st/clk/stm32mp1_clkfunc.c @@ -265,11 +265,11 @@ int fdt_rcc_subnode_offset(const char *name) * This function gets the pointer to a rcc-clk property from its name. * It reads the values indicated inside the device tree. * Length of the property is stored in the second parameter. - * Returns pointer if success, and NULL value else. + * Returns pointer on success, and NULL value on failure. ******************************************************************************/ -const uint32_t *fdt_rcc_read_prop(const char *prop_name, int *lenp) +const fdt32_t *fdt_rcc_read_prop(const char *prop_name, int *lenp) { - const uint32_t *cuint; + const fdt32_t *cuint; int node, len; void *fdt; |