gateway: simplify deserialize_gw_speed
authorFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 18 Jul 2012 16:40:51 +0000 (18:40 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 25 Jul 2012 06:55:06 +0000 (08:55 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/gateway.c

index 37aba5d..48b4fbe 100644 (file)
@@ -47,10 +47,9 @@ static bool v4gw_choosen_external, v6gw_choosen_external;
  */
 static uint32_t
 deserialize_gw_speed(uint8_t value) {
-  uint32_t speed, exp;
+  uint32_t speed = (value >> 3)+1;
+  uint32_t exp = value & 7;
 
-  speed = (value >> 3)+1;
-  exp = value & 7;
   while (exp-- > 0) {
     speed *= 10;
   }