]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
gpio: Fix checkpatch.pl issues
authorDaniel Lockyer <thisisdaniellockyer@gmail.com>
Wed, 10 Jun 2015 13:26:27 +0000 (14:26 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 16 Jun 2015 09:00:06 +0000 (11:00 +0200)
This patch fixes some issues given by checkpatch. Fixes include
bracket placement, spacing and indenting.

Signed-off-by: Daniel Lockyer <thisisdaniellockyer@gmail.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-altera.c
drivers/gpio/gpio-crystalcove.c
drivers/gpio/gpio-f7188x.c
drivers/gpio/gpio-it8761e.c
drivers/gpio/gpiolib.c

index 449fb46cb8a0c7205401d2b9f57d14e040cc1122..0f3d336d6303e9c4745f8da260ae5e7df8299805 100644 (file)
@@ -107,7 +107,8 @@ static int altera_gpio_irq_set_type(struct irq_data *d,
        return -EINVAL;
 }
 
-static unsigned int altera_gpio_irq_startup(struct irq_data *d) {
+static unsigned int altera_gpio_irq_startup(struct irq_data *d)
+{
        altera_gpio_irq_unmask(d);
 
        return 0;
index 2c39811366bffc4c05e1e44721ac5efca8c6d158..fddd204dc9b68484c473c267803b9d1216fe4535 100644 (file)
@@ -95,9 +95,8 @@ static inline int to_reg(int gpio, enum ctrl_register reg_type)
 {
        int reg;
 
-       if (gpio == 94) {
+       if (gpio == 94)
                return GPIOPANELCTL;
-       }
 
        if (reg_type == CTRL_IN) {
                if (gpio < 8)
index dbda8433c4f7ef9af3855add277b6d5ed74e95fb..5e3c4fa67d820f4dfd22c5409c4194f7d1faff2c 100644 (file)
@@ -172,7 +172,7 @@ static struct f7188x_gpio_bank f71869a_gpio_bank[] = {
 };
 
 static struct f7188x_gpio_bank f71882_gpio_bank[] = {
-       F7188X_GPIO_BANK(0 , 8, 0xF0),
+       F7188X_GPIO_BANK(0, 8, 0xF0),
        F7188X_GPIO_BANK(10, 8, 0xE0),
        F7188X_GPIO_BANK(20, 8, 0xD0),
        F7188X_GPIO_BANK(30, 4, 0xC0),
@@ -180,7 +180,7 @@ static struct f7188x_gpio_bank f71882_gpio_bank[] = {
 };
 
 static struct f7188x_gpio_bank f71889_gpio_bank[] = {
-       F7188X_GPIO_BANK(0 , 7, 0xF0),
+       F7188X_GPIO_BANK(0, 7, 0xF0),
        F7188X_GPIO_BANK(10, 7, 0xE0),
        F7188X_GPIO_BANK(20, 8, 0xD0),
        F7188X_GPIO_BANK(30, 8, 0xC0),
index dadfc245cf0993ac27615fee19ca66262f683458..30a8f24c92c5c5b0d46835250b8b2b6aefb203a9 100644 (file)
@@ -123,7 +123,7 @@ static void it8761e_gpio_set(struct gpio_chip *gc,
 
        curr_vals = inb(reg);
        if (val)
-               outb(curr_vals | (1 << bit) , reg);
+               outb(curr_vals | (1 << bit), reg);
        else
                outb(curr_vals & ~(1 << bit), reg);
 
index 7f87b9baa90547eda034ee6fddc75493ae1e97d8..de56e5757d3ddfb01b0a50a7a863bfb5bddb1082 100644 (file)
@@ -1309,9 +1309,8 @@ static void gpio_chip_set_multiple(struct gpio_chip *chip,
                                continue;
                        }
                        /* set outputs if the corresponding mask bit is set */
-                       if (__test_and_clear_bit(i, mask)) {
+                       if (__test_and_clear_bit(i, mask))
                                chip->set(chip, i, test_bit(i, bits));
-                       }
                }
        }
 }
@@ -1329,9 +1328,9 @@ static void gpiod_set_array_value_priv(bool raw, bool can_sleep,
                unsigned long bits[BITS_TO_LONGS(chip->ngpio)];
                int count = 0;
 
-               if (!can_sleep) {
+               if (!can_sleep)
                        WARN_ON(chip->can_sleep);
-               }
+
                memset(mask, 0, sizeof(mask));
                do {
                        struct gpio_desc *desc = desc_array[i];
@@ -1346,24 +1345,22 @@ static void gpiod_set_array_value_priv(bool raw, bool can_sleep,
                         * open drain and open source outputs are set individually
                         */
                        if (test_bit(FLAG_OPEN_DRAIN, &desc->flags)) {
-                               _gpio_set_open_drain_value(desc,value);
+                               _gpio_set_open_drain_value(desc, value);
                        } else if (test_bit(FLAG_OPEN_SOURCE, &desc->flags)) {
                                _gpio_set_open_source_value(desc, value);
                        } else {
                                __set_bit(hwgpio, mask);
-                               if (value) {
+                               if (value)
                                        __set_bit(hwgpio, bits);
-                               } else {
+                               else
                                        __clear_bit(hwgpio, bits);
-                               }
                                count++;
                        }
                        i++;
                } while ((i < array_size) && (desc_array[i]->chip == chip));
                /* push collected bits to outputs */
-               if (count != 0) {
+               if (count != 0)
                        gpio_chip_set_multiple(chip, mask, bits);
-               }
        }
 }