Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
a6febeab
Unverified
Commit
a6febeab
authored
Nov 13, 2018
by
Antonio Nino Diaz
Browse files
Merge pull request #1676 from Yann-lms/static_analysis
Correct some issues found with static analysis tools
parents
9793e035
7227d892
Changes
8
Hide whitespace changes
Inline
Side-by-side
drivers/partition/gpt.c
View file @
a6febeab
...
@@ -13,10 +13,14 @@
...
@@ -13,10 +13,14 @@
static
int
unicode_to_ascii
(
unsigned
short
*
str_in
,
unsigned
char
*
str_out
)
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
;
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 */
/* check whether the unicode string is valid */
for
(
i
=
1
;
i
<
(
EFI_NAMELEN
<<
1
);
i
+=
2
)
{
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)
...
@@ -36,7 +40,7 @@ int parse_gpt_entry(gpt_entry_t *gpt_entry, partition_entry_t *entry)
{
{
int
result
;
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
))
{
if
((
gpt_entry
->
first_lba
==
0
)
&&
(
gpt_entry
->
last_lba
==
0
))
{
return
-
EINVAL
;
return
-
EINVAL
;
...
...
drivers/st/clk/stm32mp1_clk.c
View file @
a6febeab
...
@@ -1323,7 +1323,7 @@ int stm32mp1_clk_init(void)
...
@@ -1323,7 +1323,7 @@ int stm32mp1_clk_init(void)
int
ret
,
len
;
int
ret
,
len
;
enum
stm32mp1_pll_id
i
;
enum
stm32mp1_pll_id
i
;
bool
lse_css
=
false
;
bool
lse_css
=
false
;
const
uin
t32_t
*
pkcs_cell
;
const
fd
t32_t
*
pkcs_cell
;
/* Check status field to disable security */
/* Check status field to disable security */
if
(
!
fdt_get_rcc_secure_status
())
{
if
(
!
fdt_get_rcc_secure_status
())
{
...
@@ -1529,7 +1529,7 @@ int stm32mp1_clk_init(void)
...
@@ -1529,7 +1529,7 @@ int stm32mp1_clk_init(void)
priv
->
pkcs_usb_value
=
0
;
priv
->
pkcs_usb_value
=
0
;
for
(
j
=
0
;
j
<
((
uint32_t
)
len
/
sizeof
(
uint32_t
));
j
++
)
{
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
)
{
if
(
pkcs
==
(
uint32_t
)
CLK_CKPER_DISABLED
)
{
ckper_disabled
=
true
;
ckper_disabled
=
true
;
...
...
drivers/st/clk/stm32mp1_clkfunc.c
View file @
a6febeab
...
@@ -265,11 +265,11 @@ int fdt_rcc_subnode_offset(const char *name)
...
@@ -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.
* This function gets the pointer to a rcc-clk property from its name.
* It reads the values indicated inside the device tree.
* It reads the values indicated inside the device tree.
* Length of the property is stored in the second parameter.
* Length of the property is stored in the second parameter.
* Returns pointer
if
success, and NULL value
els
e.
* Returns pointer
on
success, and NULL value
on failur
e.
******************************************************************************/
******************************************************************************/
const
uin
t32_t
*
fdt_rcc_read_prop
(
const
char
*
prop_name
,
int
*
lenp
)
const
fd
t32_t
*
fdt_rcc_read_prop
(
const
char
*
prop_name
,
int
*
lenp
)
{
{
const
uin
t32_t
*
cuint
;
const
fd
t32_t
*
cuint
;
int
node
,
len
;
int
node
,
len
;
void
*
fdt
;
void
*
fdt
;
...
...
include/drivers/st/stm32mp1_clkfunc.h
View file @
a6febeab
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
#ifndef STM32MP1_CLKFUNC_H
#ifndef STM32MP1_CLKFUNC_H
#define STM32MP1_CLKFUNC_H
#define STM32MP1_CLKFUNC_H
#include <libfdt.h>
#include <stdbool.h>
#include <stdbool.h>
enum
stm32mp_osc_id
{
enum
stm32mp_osc_id
{
...
@@ -33,7 +34,7 @@ uint32_t fdt_rcc_read_addr(void);
...
@@ -33,7 +34,7 @@ uint32_t fdt_rcc_read_addr(void);
int
fdt_rcc_read_uint32_array
(
const
char
*
prop_name
,
int
fdt_rcc_read_uint32_array
(
const
char
*
prop_name
,
uint32_t
*
array
,
uint32_t
count
);
uint32_t
*
array
,
uint32_t
count
);
int
fdt_rcc_subnode_offset
(
const
char
*
name
);
int
fdt_rcc_subnode_offset
(
const
char
*
name
);
const
uin
t32_t
*
fdt_rcc_read_prop
(
const
char
*
prop_name
,
int
*
lenp
);
const
fd
t32_t
*
fdt_rcc_read_prop
(
const
char
*
prop_name
,
int
*
lenp
);
bool
fdt_get_rcc_secure_status
(
void
);
bool
fdt_get_rcc_secure_status
(
void
);
uintptr_t
fdt_get_stgen_base
(
void
);
uintptr_t
fdt_get_stgen_base
(
void
);
...
...
include/drivers/st/stm32mp1_ddr_regs.h
View file @
a6febeab
...
@@ -408,6 +408,4 @@ struct stm32mp1_ddrphy {
...
@@ -408,6 +408,4 @@ struct stm32mp1_ddrphy {
#define DDRPHYC_DXNDLLCR_SDPHASE_MASK GENMASK(17, 14)
#define DDRPHYC_DXNDLLCR_SDPHASE_MASK GENMASK(17, 14)
#define DDRPHYC_DXNDLLCR_SDPHASE_SHIFT 14
#define DDRPHYC_DXNDLLCR_SDPHASE_SHIFT 14
void
ddr_enable_clock
(
void
);
#endif
/* STM32MP1_DDR_REGS_H */
#endif
/* STM32MP1_DDR_REGS_H */
include/lib/psci/psci.h
View file @
a6febeab
...
@@ -302,10 +302,10 @@ typedef struct plat_psci_ops {
...
@@ -302,10 +302,10 @@ typedef struct plat_psci_ops {
void
(
*
pwr_domain_on_finish
)(
const
psci_power_state_t
*
target_state
);
void
(
*
pwr_domain_on_finish
)(
const
psci_power_state_t
*
target_state
);
void
(
*
pwr_domain_suspend_finish
)(
void
(
*
pwr_domain_suspend_finish
)(
const
psci_power_state_t
*
target_state
);
const
psci_power_state_t
*
target_state
);
void
(
*
pwr_domain_pwr_down_wfi
)(
void
__dead2
(
*
pwr_domain_pwr_down_wfi
)(
const
psci_power_state_t
*
target_state
)
__dead2
;
const
psci_power_state_t
*
target_state
);
void
(
*
system_off
)(
void
)
__dead2
;
void
__dead2
(
*
system_off
)(
void
);
void
(
*
system_reset
)(
void
)
__dead2
;
void
__dead2
(
*
system_reset
)(
void
);
int
(
*
validate_power_state
)(
unsigned
int
power_state
,
int
(
*
validate_power_state
)(
unsigned
int
power_state
,
psci_power_state_t
*
req_state
);
psci_power_state_t
*
req_state
);
int
(
*
validate_ns_entrypoint
)(
uintptr_t
ns_entrypoint
);
int
(
*
validate_ns_entrypoint
)(
uintptr_t
ns_entrypoint
);
...
...
plat/st/stm32mp1/bl2_io_storage.c
View file @
a6febeab
...
@@ -37,7 +37,7 @@ static io_block_spec_t gpt_block_spec = {
...
@@ -37,7 +37,7 @@ static io_block_spec_t gpt_block_spec = {
.
length
=
34
*
MMC_BLOCK_SIZE
,
/* Size of GPT table */
.
length
=
34
*
MMC_BLOCK_SIZE
,
/* Size of GPT table */
};
};
uint32_t
block_buffer
[
MMC_BLOCK_SIZE
]
__aligned
(
MMC_BLOCK_SIZE
);
static
uint32_t
block_buffer
[
MMC_BLOCK_SIZE
]
__aligned
(
MMC_BLOCK_SIZE
);
static
const
io_block_dev_spec_t
mmc_block_dev_spec
=
{
static
const
io_block_dev_spec_t
mmc_block_dev_spec
=
{
/* It's used as temp buffer in block driver */
/* It's used as temp buffer in block driver */
...
...
plat/st/stm32mp1/plat_image_load.c
View file @
a6febeab
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
*/
*/
#include <desc_image_load.h>
#include <desc_image_load.h>
#include <platform.h>
/*******************************************************************************
/*******************************************************************************
* This function flushes the data structures so that they are visible
* This function flushes the data structures so that they are visible
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment