Commit 00affcac authored by Arnd Bergmann's avatar Arnd Bergmann

soc: qcom/spm: shut up uninitialized variable warning

gcc warns about the 'found' variable possibly being used uninitialized:

drivers/soc/qcom/spm.c: In function 'spm_dev_probe':
drivers/soc/qcom/spm.c:305:5: error: 'found' may be used uninitialized in this function [-Werror=maybe-uninitialized]

However, the code is correct because we know that there is
always at least one online CPU. This initializes the 'found'
variable to zero before the loop so the compiler knows
it does not have to warn about it.
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 6551b8c9
...@@ -288,7 +288,7 @@ static struct spm_driver_data *spm_get_drv(struct platform_device *pdev, ...@@ -288,7 +288,7 @@ static struct spm_driver_data *spm_get_drv(struct platform_device *pdev,
struct spm_driver_data *drv = NULL; struct spm_driver_data *drv = NULL;
struct device_node *cpu_node, *saw_node; struct device_node *cpu_node, *saw_node;
int cpu; int cpu;
bool found; bool found = 0;
for_each_possible_cpu(cpu) { for_each_possible_cpu(cpu) {
cpu_node = of_cpu_device_node_get(cpu); cpu_node = of_cpu_device_node_get(cpu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment