atheros: various braces fixes
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Tue, 10 Jun 2014 09:05:51 +0000 (09:05 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Tue, 10 Jun 2014 09:05:51 +0000 (09:05 +0000)
Fix braces location, remove unnecessary empty lines before or after code
block, remove useless braces. All cases are detected by checkpatch.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@41087 3c298f89-4303-0410-b956-a3cf2f4a3e73

target/linux/atheros/patches-3.10/100-board.patch
target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch
target/linux/atheros/patches-3.10/130-watchdog.patch
target/linux/atheros/patches-3.10/140-redboot_boardconfig.patch
target/linux/atheros/patches-3.10/142-redboot_various_erase_size_fix.patch
target/linux/atheros/patches-3.10/220-enet_micrel_workaround.patch
target/linux/atheros/patches-3.10/230-3_10-updates.patch

index 7192a7b..5c81e02 100644 (file)
 +check_radio_magic(u8 *addr)
 +{
 +      addr += 0x7a; /* offset for flash magic */
 +check_radio_magic(u8 *addr)
 +{
 +      addr += 0x7a; /* offset for flash magic */
-+      if ((addr[0] == 0x5a) && (addr[1] == 0xa5)) {
++      if ((addr[0] == 0x5a) && (addr[1] == 0xa5))
 +              return 1;
 +              return 1;
-+      }
++
 +      return 0;
 +}
 +
 +      return 0;
 +}
 +
 +#endif /* __ASM_MACH_GENERIC_DMA_COHERENCE_H */
 --- /dev/null
 +++ b/arch/mips/include/asm/mach-ar231x/gpio.h
 +#endif /* __ASM_MACH_GENERIC_DMA_COHERENCE_H */
 --- /dev/null
 +++ b/arch/mips/include/asm/mach-ar231x/gpio.h
-@@ -0,0 +1,28 @@
+@@ -0,0 +1,30 @@
 +#ifndef _ATHEROS_GPIO_H_
 +#define _ATHEROS_GPIO_H_
 +
 +#ifndef _ATHEROS_GPIO_H_
 +#define _ATHEROS_GPIO_H_
 +
 +/* not sure if these are used? */
 +
 +/* Returns IRQ to attach for gpio.  Unchecked function */
 +/* not sure if these are used? */
 +
 +/* Returns IRQ to attach for gpio.  Unchecked function */
-+static inline int gpio_to_irq(unsigned gpio) {
++static inline int gpio_to_irq(unsigned gpio)
++{
 +      return AR531X_GPIO_IRQ(gpio);
 +}
 +
 +/* Returns gpio for IRQ attached.  Unchecked function */
 +      return AR531X_GPIO_IRQ(gpio);
 +}
 +
 +/* Returns gpio for IRQ attached.  Unchecked function */
-+static inline int irq_to_gpio(unsigned irq) {
++static inline int irq_to_gpio(unsigned irq)
++{
 +      return irq - AR531X_GPIO_IRQ(0);
 +}
 +
 +      return irq - AR531X_GPIO_IRQ(0);
 +}
 +
 +
 --- /dev/null
 +++ b/arch/mips/ar231x/ar5312.c
 +
 --- /dev/null
 +++ b/arch/mips/ar231x/ar5312.c
-@@ -0,0 +1,580 @@
+@@ -0,0 +1,579 @@
 +/*
 + * This file is subject to the terms and conditions of the GNU General Public
 + * License.  See the file "COPYING" in the main directory of this archive
 +/*
 + * This file is subject to the terms and conditions of the GNU General Public
 + * License.  See the file "COPYING" in the main directory of this archive
 +{
 +      /* reset the system */
 +      local_irq_disable();
 +{
 +      /* reset the system */
 +      local_irq_disable();
-+      while(1) {
++      while (1)
 +              ar231x_write_reg(AR531X_RESET, AR531X_RESET_SYSTEM);
 +              ar231x_write_reg(AR531X_RESET, AR531X_RESET_SYSTEM);
-+      }
 +}
 +
 +
 +}
 +
 +
 +      predivisor = clockctl1_predivide_table[predivide_select];
 +      multiplier = (clock_ctl1 & multiplier_mask) >> multiplier_shift;
 +
 +      predivisor = clockctl1_predivide_table[predivide_select];
 +      multiplier = (clock_ctl1 & multiplier_mask) >> multiplier_shift;
 +
-+      if (clock_ctl1 & doubler_mask) {
++      if (clock_ctl1 & doubler_mask)
 +              multiplier = multiplier << 1;
 +              multiplier = multiplier << 1;
-+      }
++
 +      return (40000000 / predivisor) * multiplier;
 +}
 +
 +      return (40000000 / predivisor) * multiplier;
 +}
 +
 +
 --- /dev/null
 +++ b/arch/mips/ar231x/ar2315.c
 +
 --- /dev/null
 +++ b/arch/mips/ar231x/ar2315.c
-@@ -0,0 +1,693 @@
+@@ -0,0 +1,692 @@
 +/*
 + * This file is subject to the terms and conditions of the GNU General Public
 + * License.  See the file "COPYING" in the main directory of this archive
 +/*
 + * This file is subject to the terms and conditions of the GNU General Public
 + * License.  See the file "COPYING" in the main directory of this archive
 +      int i, led = 0;
 +
 +      ar2315_led_data.num_leds = 0;
 +      int i, led = 0;
 +
 +      ar2315_led_data.num_leds = 0;
-+      for(i = 1; i < 8; i++)
-+      {
++      for (i = 1; i < 8; i++) {
 +              if((i == AR2315_RESET_GPIO) ||
 +                 (i == ar231x_board.config->reset_config_gpio))
 +                      continue;
 +              if((i == AR2315_RESET_GPIO) ||
 +                 (i == ar231x_board.config->reset_config_gpio))
 +                      continue;
index 38b2969..13ae8a4 100644 (file)
@@ -32,7 +32,7 @@
 +obj-$(CONFIG_NET_VENDOR_AR231X) += ar231x.o
 --- /dev/null
 +++ b/drivers/net/ethernet/ar231x/ar231x.c
 +obj-$(CONFIG_NET_VENDOR_AR231X) += ar231x.o
 --- /dev/null
 +++ b/drivers/net/ethernet/ar231x/ar231x.c
-@@ -0,0 +1,1266 @@
+@@ -0,0 +1,1260 @@
 +/*
 + * ar231x.c: Linux driver for the Atheros AR231x Ethernet device.
 + *
 +/*
 + * ar231x.c: Linux driver for the Atheros AR231x Ethernet device.
 + *
 +
 +      add_timer(&sp->link_timer);
 +      return 0;
 +
 +      add_timer(&sp->link_timer);
 +      return 0;
-+
 +}
 +
 +static void ar231x_link_timer_fn(unsigned long data)
 +}
 +
 +static void ar231x_link_timer_fn(unsigned long data)
 +       * Loop faster when we don't have link.
 +       * This was needed to speed up the AP bootstrap time.
 +       */
 +       * Loop faster when we don't have link.
 +       * This was needed to speed up the AP bootstrap time.
 +       */
-+      if (sp->link == 0) {
++      if (sp->link == 0)
 +              mod_timer(&sp->link_timer, jiffies + HZ / 2);
 +              mod_timer(&sp->link_timer, jiffies + HZ / 2);
-+      } else {
++      else
 +              mod_timer(&sp->link_timer, jiffies + LINK_TIMER);
 +              mod_timer(&sp->link_timer, jiffies + LINK_TIMER);
-+      }
 +}
 +
 +static void ar231x_check_link(struct net_device *dev)
 +}
 +
 +static void ar231x_check_link(struct net_device *dev)
 + */
 +static void ar231x_load_rx_ring(struct net_device *dev, int nr_bufs)
 +{
 + */
 +static void ar231x_load_rx_ring(struct net_device *dev, int nr_bufs)
 +{
-+
 +      struct ar231x_private *sp = netdev_priv(dev);
 +      short i, idx;
 +
 +      struct ar231x_private *sp = netdev_priv(dev);
 +      short i, idx;
 +
 +
 +      /* process at most the entire ring and then wait for another int */
 +      while (1) {
 +
 +      /* process at most the entire ring and then wait for another int */
 +      while (1) {
-+
 +              rxdesc = &sp->rx_ring[idx];
 +              status = rxdesc->status;
 +              rxdesc = &sp->rx_ring[idx];
 +              status = rxdesc->status;
++
 +              if (status & DMA_RX_OWN) {
 +                      /* SiByte owns descriptor or descr not yet filled in */
 +                      rval = 0;
 +              if (status & DMA_RX_OWN) {
 +                      /* SiByte owns descriptor or descr not yet filled in */
 +                      rval = 0;
 +                      /* alloc new buffer. */
 +                      skb_new = netdev_alloc_skb_ip_align(dev, AR2313_BUFSIZE);
 +                      if (skb_new != NULL) {
 +                      /* alloc new buffer. */
 +                      skb_new = netdev_alloc_skb_ip_align(dev, AR2313_BUFSIZE);
 +                      if (skb_new != NULL) {
-+
 +                              skb = sp->rx_skb[idx];
 +                              /* set skb */
 +                              skb_put(skb,
 +                              skb = sp->rx_skb[idx];
 +                              /* set skb */
 +                              skb_put(skb,
 +      struct net_device *dev = (struct net_device *) data;
 +      struct ar231x_private *sp = netdev_priv(dev);
 +
 +      struct net_device *dev = (struct net_device *) data;
 +      struct ar231x_private *sp = netdev_priv(dev);
 +
-+      if (sp->unloading) {
++      if (sp->unloading)
 +              return;
 +              return;
-+      }
 +
 +      if (ar231x_rx_int(dev)) {
 +              tasklet_hi_schedule(&sp->rx_tasklet);
 +
 +      if (ar231x_rx_int(dev)) {
 +              tasklet_hi_schedule(&sp->rx_tasklet);
 +      }
 +
 +      /* abnormal status */
 +      }
 +
 +      /* abnormal status */
-+      if (status & (DMA_STATUS_FBE | DMA_STATUS_TPS)) {
++      if (status & (DMA_STATUS_FBE | DMA_STATUS_TPS))
 +              ar231x_restart(dev);
 +              ar231x_restart(dev);
-+      }
++
 +      return IRQ_HANDLED;
 +}
 +
 +      return IRQ_HANDLED;
 +}
 +
 +      int ret;
 +
 +      switch (cmd) {
 +      int ret;
 +
 +      switch (cmd) {
-+
 +      case SIOCETHTOOL:
 +              spin_lock_irq(&sp->lock);
 +              ret = phy_ethtool_ioctl(sp->phy_dev, (void *) ifr->ifr_data);
 +      case SIOCETHTOOL:
 +              spin_lock_irq(&sp->lock);
 +              ret = phy_ethtool_ioctl(sp->phy_dev, (void *) ifr->ifr_data);
index 506b5f9..97b79b9 100644 (file)
@@ -1,6 +1,6 @@
 --- /dev/null
 +++ b/drivers/watchdog/ar2315-wtd.c
 --- /dev/null
 +++ b/drivers/watchdog/ar2315-wtd.c
-@@ -0,0 +1,200 @@
+@@ -0,0 +1,197 @@
 +/*
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License as published by
 +/*
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License as published by
@@ -82,8 +82,7 @@
 +static irqreturn_t
 +ar2315_wdt_interrupt(int irq, void *dev_id)
 +{
 +static irqreturn_t
 +ar2315_wdt_interrupt(int irq, void *dev_id)
 +{
-+      if(started)
-+      {
++      if (started) {
 +              printk(KERN_CRIT "watchdog expired, rebooting system\n");
 +              emergency_restart();
 +      } else {
 +              printk(KERN_CRIT "watchdog expired, rebooting system\n");
 +              emergency_restart();
 +      } else {
 +      int new_wdt_timeout;
 +      int ret = -ENOIOCTLCMD;
 +
 +      int new_wdt_timeout;
 +      int ret = -ENOIOCTLCMD;
 +
-+      switch(cmd)
-+      {
++      switch (cmd) {
 +              case WDIOC_GETSUPPORT:
 +                      ret = copy_to_user((struct watchdog_info __user *)arg, &ident, sizeof(ident)) ? -EFAULT : 0;
 +                      break;
 +              case WDIOC_GETSUPPORT:
 +                      ret = copy_to_user((struct watchdog_info __user *)arg, &ident, sizeof(ident)) ? -EFAULT : 0;
 +                      break;
 +
 +      ar2315_wdt_enable();
 +      ret = request_irq(AR531X_MISC_IRQ_WATCHDOG, ar2315_wdt_interrupt, IRQF_DISABLED, "ar2315_wdt", NULL);
 +
 +      ar2315_wdt_enable();
 +      ret = request_irq(AR531X_MISC_IRQ_WATCHDOG, ar2315_wdt_interrupt, IRQF_DISABLED, "ar2315_wdt", NULL);
-+      if(ret)
-+      {
++      if (ret) {
 +              printk(KERN_ERR "ar2315wdt: failed to register inetrrupt\n");
 +              goto out;
 +      }
 +              printk(KERN_ERR "ar2315wdt: failed to register inetrrupt\n");
 +              goto out;
 +      }
index 4191b0d..3925b67 100644 (file)
                parts[i].size = fl->img->size;
                parts[i].offset = fl->img->flash_base;
                parts[i].name = names;
                parts[i].size = fl->img->size;
                parts[i].offset = fl->img->flash_base;
                parts[i].name = names;
-@@ -284,6 +289,14 @@ static int parse_redboot_partitions(stru
+@@ -284,6 +289,13 @@ static int parse_redboot_partitions(stru
                fl = fl->next;
                kfree(tmp_fl);
        }
                fl = fl->next;
                kfree(tmp_fl);
        }
-+      if(master->size - max_offset >= master->erasesize)
-+      {
++      if (master->size - max_offset >= master->erasesize) {
 +              parts[nrparts].size = master->size - max_offset;
 +              parts[nrparts].offset = max_offset;
 +              parts[nrparts].name = names;
 +              parts[nrparts].size = master->size - max_offset;
 +              parts[nrparts].offset = max_offset;
 +              parts[nrparts].name = names;
index fa00dcd..d901b08 100644 (file)
                fl = fl->next;
                kfree(tmp_fl);
        }
                fl = fl->next;
                kfree(tmp_fl);
        }
--      if(master->size - max_offset >= master->erasesize)
+-      if (master->size - max_offset >= master->erasesize) {
 +
 +      if (master->size - max_offset >=
 +
 +      if (master->size - max_offset >=
-+          mtd_get_offset_erasesize(master, max_offset))
-       {
++          mtd_get_offset_erasesize(master, max_offset)) {
                parts[nrparts].size = master->size - max_offset;
                parts[nrparts].offset = max_offset;
                parts[nrparts].size = master->size - max_offset;
                parts[nrparts].offset = max_offset;
+               parts[nrparts].name = names;
index 58cccd0..d7a4d4a 100644 (file)
@@ -78,7 +78,7 @@
        kfree(dev);
        return 0;
  }
        kfree(dev);
        return 0;
  }
-@@ -1120,6 +1166,9 @@ static int ar231x_ioctl(struct net_devic
+@@ -1115,6 +1161,9 @@ static int ar231x_ioctl(struct net_devic
        struct ar231x_private *sp = netdev_priv(dev);
        int ret;
  
        struct ar231x_private *sp = netdev_priv(dev);
        int ret;
  
@@ -86,5 +86,5 @@
 +              return -ENODEV;
 +
        switch (cmd) {
 +              return -ENODEV;
 +
        switch (cmd) {
        case SIOCETHTOOL:
        case SIOCETHTOOL:
+               spin_lock_irq(&sp->lock);
index 80d7eaa..2a5adf0 100644 (file)
@@ -1,6 +1,6 @@
 --- a/drivers/net/ethernet/ar231x/ar231x.c
 +++ b/drivers/net/ethernet/ar231x/ar231x.c
 --- a/drivers/net/ethernet/ar231x/ar231x.c
 +++ b/drivers/net/ethernet/ar231x/ar231x.c
-@@ -1283,7 +1283,7 @@ static int ar231x_mdiobus_probe (struct
+@@ -1277,7 +1277,7 @@ static int ar231x_mdiobus_probe (struct
        BUG_ON(!phydev);
        BUG_ON(phydev->attached_dev);
  
        BUG_ON(!phydev);
        BUG_ON(phydev->attached_dev);