changeset 3914:25c630216268

arch/nrf5x: Scope locally-used vairable in GPIO driver
author Nicolas Pouillon <nipo@ssji.net>
date Thu, 19 Apr 2018 07:39:38 +0200
parents beac21fbcf15
children 6f2b6b4e8cd9
files arch/nrf5x/drivers/gpio.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/arch/nrf5x/drivers/gpio.c	Thu Apr 19 08:24:05 2018 +0200
+++ b/arch/nrf5x/drivers/gpio.c	Thu Apr 19 07:39:38 2018 +0200
@@ -294,7 +294,7 @@
 
   LOCK_SPIN_IRQ_SCOPED(&dev->lock);
 
-  uint64_t vp, v;
+  uint64_t vp;
   uint_fast8_t shift = io_first % 32;
   uintptr_t a = NRF_GPIO_BANK_OFFSET(io_first);
 
@@ -309,6 +309,7 @@
 #if CONFIG_NRF5X_GPIO_COUNT > 32
   while (bf++ < bl)
     {
+      uint64_t v;
       a += NRF_GPIO_BANK_OFFSET(1);
       v = nrf_reg_get(GPIO_ADDR, a + NRF_GPIO_IN);  /* get P1, P2, ... inputs */
       v = (v << (32 - shift)) | vp ;