fix(st): use indices when counting GPIOs in DT

Fix MISRA C2012-18.4:
The +, -, += and -= operators should not be applied to an expression
of pointer type.
While at it, avoid computing twice the same value, by removing the
initial value computation outside the loop.

Signed-off-by: Yann Gautier <>
Change-Id: Iabfe587bf72535541c94bfa341de10148aa58030
1 file changed