Linting: storage and const correctness 09/260609/2
authorMichal Bloch <m.bloch@samsung.com>
Tue, 29 Jun 2021 18:22:46 +0000 (20:22 +0200)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Wed, 30 Jun 2021 10:19:09 +0000 (10:19 +0000)
Change-Id: I0c52f2e1e0642e1bbb48d3a02cb7f4cec6991747
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
src/peripheral_gpio.c
src/peripheral_pwm.c
src/peripheral_uart.c

index 3d92be59a074fc4524212993238a8c81f4fde573..b77bcdb11c4e3a41957cf1949c52ae142db1466b 100644 (file)
@@ -210,7 +210,7 @@ static int peripheral_gpio_set_initial_direction_into_handle(peripheral_gpio_h g
 
 static int peripheral_gpio_set_initial_edge_into_handle(peripheral_gpio_h gpio)
 {
-       static predefined_type_s types[4] = {
+       static const predefined_type_s types[4] = {
                {"none",    4},
                {"rising",  6},
                {"falling", 7},
@@ -344,7 +344,7 @@ int peripheral_gpio_set_direction(peripheral_gpio_h gpio, peripheral_gpio_direct
        RETV_IF(gpio->direction == direction, PERIPHERAL_ERROR_NONE);
        RETV_IF(gpio->edge != PERIPHERAL_GPIO_EDGE_NONE, PERIPHERAL_ERROR_IO_ERROR);
 
-       static predefined_type_s types[3] = {
+       static const predefined_type_s types[3] = {
                {"in",   2},
                {"high", 4},
                {"low",  3}
@@ -379,7 +379,7 @@ int peripheral_gpio_set_edge_mode(peripheral_gpio_h gpio, peripheral_gpio_edge_e
        RETV_IF(gpio->edge == edge, PERIPHERAL_ERROR_NONE);
        RETV_IF(gpio->direction != PERIPHERAL_GPIO_DIRECTION_IN, PERIPHERAL_ERROR_IO_ERROR);
 
-       static predefined_type_s types[4] = {
+       static const predefined_type_s types[4] = {
                {"none",    4},
                {"rising",  6},
                {"falling", 7},
@@ -549,7 +549,7 @@ int peripheral_gpio_write(peripheral_gpio_h gpio, uint32_t value)
         */
        RETV_IF(gpio->direction == PERIPHERAL_GPIO_DIRECTION_IN, PERIPHERAL_ERROR_IO_ERROR);
 
-       static predefined_type_s types[2] = {
+       static const predefined_type_s types[2] = {
                {"0", 1},
                {"1", 1}
        };
index 80b290744a14ee03f449eb5f654fe93fc929d73e..cedab7a115a1c746a6f780730db0598d97c71201 100644 (file)
@@ -286,7 +286,7 @@ int peripheral_pwm_set_polarity(peripheral_pwm_h pwm, peripheral_pwm_polarity_e
        RETVM_IF(pwm == NULL, PERIPHERAL_ERROR_INVALID_PARAMETER, "pwm handle is NULL");
        RETVM_IF((polarity < PERIPHERAL_PWM_POLARITY_ACTIVE_HIGH) || (polarity > PERIPHERAL_PWM_POLARITY_ACTIVE_LOW), PERIPHERAL_ERROR_INVALID_PARAMETER, "Invalid polarity parameter");
 
-       static predefined_type_s types[2] = {
+       static const predefined_type_s types[2] = {
                {"normal",   6},
                {"inversed", 8}
        };
@@ -302,7 +302,7 @@ int peripheral_pwm_set_enabled(peripheral_pwm_h pwm, bool enable)
        RETVM_IF(!__is_feature_supported(), PERIPHERAL_ERROR_NOT_SUPPORTED, "PWM feature is not supported");
        RETVM_IF(pwm == NULL, PERIPHERAL_ERROR_INVALID_PARAMETER, "pwm handle is NULL");
 
-       static predefined_type_s types[2] = {
+       static const predefined_type_s types[2] = {
                {"0", 1},
                {"1", 1}
        };
index 6a649df7bec62d0da1486670f4135223cd2d320b..11a5e9afa3522afe9c1a591c60b697ee551d8d6d 100644 (file)
@@ -82,7 +82,7 @@ int peripheral_uart_open_flags(int port, peripheral_open_flags_e flags, peripher
                return PERIPHERAL_ERROR_OUT_OF_MEMORY;
        }
 
-       const char *sysfs_uart_path[] = {
+       static const char *const sysfs_uart_path[] = {
                "/dev/ttyS",
                "/dev/ttyAMA",
                "/dev/ttySAC",