Fix static analysis issue 12/138712/1
authorHyeongsik Min <hyeongsik.min@samsung.com>
Thu, 13 Jul 2017 08:57:29 +0000 (17:57 +0900)
committerHyeongsik Min <hyeongsik.min@samsung.com>
Thu, 13 Jul 2017 08:57:29 +0000 (17:57 +0900)
Avoid possible overflow by casting before arithmetic operation

Change-Id: I0190740a7f3534427ef01fa29ab24bbf7405635e
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
src/daemon/peripheral_bus_gpio.c

index a853863..2eb60c2 100644 (file)
@@ -323,7 +323,7 @@ static gboolean  peripheral_bus_gpio_cb(GIOChannel *io, GIOCondition condition,
        else if (gpio_data->edge == PERIPHERAL_GPIO_EDGE_FALLING && value == 1)
                return TRUE;
 
-       timestamp = (unsigned long long)(time.tv_sec * 1000000 + time.tv_usec);
+       timestamp = (unsigned long long)time.tv_sec * 1000000 + time.tv_usec;
        peripheral_bus_emit_gpio_changed(gpio_data->gpio_skeleton, gpio_data->pin, value, timestamp);
 
        return TRUE;