Linting: improve variable scoping 07/260607/2
authorMichal Bloch <m.bloch@samsung.com>
Tue, 29 Jun 2021 18:03:43 +0000 (20:03 +0200)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Wed, 30 Jun 2021 10:18:03 +0000 (10:18 +0000)
commitc9c9e63362298e5a9ff322633dc709fe89a0db82
treed6c665adc3ee49b68a043a4f86ef0fbe7baabc9a
parent0839ab127a932d6322242c9ae5e44c4bed06a6a7
Linting: improve variable scoping

Declare variables at their first site of use where possible, especially
those with the cleanup attribute, but also some arrays that have to be
zeroed before use. This way we won't have wasted time preparing them if
an earlier step fails.

Change-Id: Ic46bdd38915f709bac37c7bfff9ba6dcb19f7657
src/common.c
src/peripheral_adc.c
src/peripheral_gpio.c
src/peripheral_i2c.c
src/peripheral_pwm.c
src/peripheral_spi.c
src/peripheral_uart.c