atheros: various braces fixes

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>

SVN-Revision: 41087
master
Felix Fietkau 10 years ago
parent 58d70ff9b3
commit 15a2ebbc38
  1. 26
      target/linux/atheros/patches-3.10/100-board.patch
  2. 20
      target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch
  3. 11
      target/linux/atheros/patches-3.10/130-watchdog.patch
  4. 5
      target/linux/atheros/patches-3.10/140-redboot_boardconfig.patch
  5. 6
      target/linux/atheros/patches-3.10/142-redboot_various_erase_size_fix.patch
  6. 4
      target/linux/atheros/patches-3.10/220-enet_micrel_workaround.patch
  7. 2
      target/linux/atheros/patches-3.10/230-3_10-updates.patch

@ -121,9 +121,9 @@
+check_radio_magic(u8 *addr) +check_radio_magic(u8 *addr)
+{ +{
+ addr += 0x7a; /* offset for flash magic */ + 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;
+} +}
+ +
@ -638,7 +638,7 @@
+#endif /* __ASM_MACH_GENERIC_DMA_COHERENCE_H */ +#endif /* __ASM_MACH_GENERIC_DMA_COHERENCE_H */
--- /dev/null --- /dev/null
+++ b/arch/mips/include/asm/mach-ar231x/gpio.h +++ b/arch/mips/include/asm/mach-ar231x/gpio.h
@@ -0,0 +1,28 @@ @@ -0,0 +1,30 @@
+#ifndef _ATHEROS_GPIO_H_ +#ifndef _ATHEROS_GPIO_H_
+#define _ATHEROS_GPIO_H_ +#define _ATHEROS_GPIO_H_
+ +
@ -655,12 +655,14 @@
+/* not sure if these are used? */ +/* not sure if these are used? */
+ +
+/* Returns IRQ to attach for gpio. Unchecked function */ +/* 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); + return AR531X_GPIO_IRQ(gpio);
+} +}
+ +
+/* Returns gpio for IRQ attached. Unchecked function */ +/* 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);
+} +}
+ +
@ -1524,7 +1526,7 @@
+ +
--- /dev/null --- /dev/null
+++ b/arch/mips/ar231x/ar5312.c +++ 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 + * 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 + * License. See the file "COPYING" in the main directory of this archive
@ -1959,9 +1961,8 @@
+{ +{
+ /* reset the system */ + /* reset the system */
+ local_irq_disable(); + local_irq_disable();
+ while(1) { + while (1)
+ ar231x_write_reg(AR531X_RESET, AR531X_RESET_SYSTEM); + ar231x_write_reg(AR531X_RESET, AR531X_RESET_SYSTEM);
+ }
+} +}
+ +
+ +
@ -2027,9 +2028,9 @@
+ predivisor = clockctl1_predivide_table[predivide_select]; + predivisor = clockctl1_predivide_table[predivide_select];
+ multiplier = (clock_ctl1 & multiplier_mask) >> multiplier_shift; + 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;
+} +}
+ +
@ -2107,7 +2108,7 @@
+ +
--- /dev/null --- /dev/null
+++ b/arch/mips/ar231x/ar2315.c +++ 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 + * 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 + * License. See the file "COPYING" in the main directory of this archive
@ -2602,8 +2603,7 @@
+ int i, led = 0; + int i, led = 0;
+ +
+ ar2315_led_data.num_leds = 0; + ar2315_led_data.num_leds = 0;
+ for(i = 1; i < 8; i++) + for (i = 1; i < 8; i++) {
+ {
+ if((i == AR2315_RESET_GPIO) || + if((i == AR2315_RESET_GPIO) ||
+ (i == ar231x_board.config->reset_config_gpio)) + (i == ar231x_board.config->reset_config_gpio))
+ continue; + continue;

@ -32,7 +32,7 @@
+obj-$(CONFIG_NET_VENDOR_AR231X) += ar231x.o +obj-$(CONFIG_NET_VENDOR_AR231X) += ar231x.o
--- /dev/null --- /dev/null
+++ b/drivers/net/ethernet/ar231x/ar231x.c +++ 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.
+ * + *
@ -535,7 +535,6 @@
+ +
+ add_timer(&sp->link_timer); + add_timer(&sp->link_timer);
+ return 0; + return 0;
+
+} +}
+ +
+static void ar231x_link_timer_fn(unsigned long data) +static void ar231x_link_timer_fn(unsigned long data)
@ -554,11 +553,10 @@
+ * Loop faster when we don't have link. + * Loop faster when we don't have link.
+ * This was needed to speed up the AP bootstrap time. + * 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)
@ -764,7 +762,6 @@
+ */ + */
+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); + struct ar231x_private *sp = netdev_priv(dev);
+ short i, idx; + short i, idx;
+ +
@ -824,9 +821,9 @@
+ +
+ /* process at most the entire ring and then wait for another int */ + /* process at most the entire ring and then wait for another int */
+ while (1) { + while (1) {
+
+ rxdesc = &sp->rx_ring[idx]; + rxdesc = &sp->rx_ring[idx];
+ status = rxdesc->status; + status = rxdesc->status;
+
+ if (status & DMA_RX_OWN) { + if (status & DMA_RX_OWN) {
+ /* SiByte owns descriptor or descr not yet filled in */ + /* SiByte owns descriptor or descr not yet filled in */
+ rval = 0; + rval = 0;
@ -858,7 +855,6 @@
+ /* alloc new buffer. */ + /* alloc new buffer. */
+ skb_new = netdev_alloc_skb_ip_align(dev, AR2313_BUFSIZE); + skb_new = netdev_alloc_skb_ip_align(dev, AR2313_BUFSIZE);
+ if (skb_new != NULL) { + if (skb_new != NULL) {
+
+ skb = sp->rx_skb[idx]; + skb = sp->rx_skb[idx];
+ /* set skb */ + /* set skb */
+ skb_put(skb, + skb_put(skb,
@ -953,9 +949,8 @@
+ struct net_device *dev = (struct net_device *) data; + struct net_device *dev = (struct net_device *) data;
+ struct ar231x_private *sp = netdev_priv(dev); + struct ar231x_private *sp = netdev_priv(dev);
+ +
+ if (sp->unloading) { + if (sp->unloading)
+ return; + return;
+ }
+ +
+ if (ar231x_rx_int(dev)) { + if (ar231x_rx_int(dev)) {
+ tasklet_hi_schedule(&sp->rx_tasklet); + tasklet_hi_schedule(&sp->rx_tasklet);
@ -1005,9 +1000,9 @@
+ } + }
+ +
+ /* 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;
+} +}
+ +
@ -1156,7 +1151,6 @@
+ int ret; + int ret;
+ +
+ switch (cmd) { + switch (cmd) {
+
+ case SIOCETHTOOL: + case SIOCETHTOOL:
+ spin_lock_irq(&sp->lock); + spin_lock_irq(&sp->lock);
+ ret = phy_ethtool_ioctl(sp->phy_dev, (void *) ifr->ifr_data); + ret = phy_ethtool_ioctl(sp->phy_dev, (void *) ifr->ifr_data);

@ -1,6 +1,6 @@
--- /dev/null --- /dev/null
+++ b/drivers/watchdog/ar2315-wtd.c +++ 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 + * 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 + * it under the terms of the GNU General Public License as published by
@ -82,8 +82,7 @@
+static irqreturn_t +static irqreturn_t
+ar2315_wdt_interrupt(int irq, void *dev_id) +ar2315_wdt_interrupt(int irq, void *dev_id)
+{ +{
+ if(started) + if (started) {
+ {
+ printk(KERN_CRIT "watchdog expired, rebooting system\n"); + printk(KERN_CRIT "watchdog expired, rebooting system\n");
+ emergency_restart(); + emergency_restart();
+ } else { + } else {
@ -105,8 +104,7 @@
+ int new_wdt_timeout; + int new_wdt_timeout;
+ int ret = -ENOIOCTLCMD; + int ret = -ENOIOCTLCMD;
+ +
+ switch(cmd) + switch (cmd) {
+ {
+ case WDIOC_GETSUPPORT: + case WDIOC_GETSUPPORT:
+ ret = copy_to_user((struct watchdog_info __user *)arg, &ident, sizeof(ident)) ? -EFAULT : 0; + ret = copy_to_user((struct watchdog_info __user *)arg, &ident, sizeof(ident)) ? -EFAULT : 0;
+ break; + break;
@ -153,8 +151,7 @@
+ +
+ ar2315_wdt_enable(); + ar2315_wdt_enable();
+ ret = request_irq(AR531X_MISC_IRQ_WATCHDOG, ar2315_wdt_interrupt, IRQF_DISABLED, "ar2315_wdt", NULL); + 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"); + printk(KERN_ERR "ar2315wdt: failed to register inetrrupt\n");
+ goto out; + goto out;
+ } + }

@ -43,12 +43,11 @@
parts[i].size = fl->img->size; parts[i].size = fl->img->size;
parts[i].offset = fl->img->flash_base; parts[i].offset = fl->img->flash_base;
parts[i].name = names; 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; fl = fl->next;
kfree(tmp_fl); 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].size = master->size - max_offset;
+ parts[nrparts].offset = max_offset; + parts[nrparts].offset = max_offset;
+ parts[nrparts].name = names; + parts[nrparts].name = names;

@ -63,10 +63,10 @@
fl = fl->next; fl = fl->next;
kfree(tmp_fl); 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].size = master->size - max_offset;
parts[nrparts].offset = max_offset; parts[nrparts].offset = max_offset;
parts[nrparts].name = names;

@ -78,7 +78,7 @@
kfree(dev); kfree(dev);
return 0; 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); struct ar231x_private *sp = netdev_priv(dev);
int ret; int ret;
@ -86,5 +86,5 @@
+ return -ENODEV; + return -ENODEV;
+ +
switch (cmd) { switch (cmd) {
case SIOCETHTOOL: case SIOCETHTOOL:
spin_lock_irq(&sp->lock);

@ -1,6 +1,6 @@
--- a/drivers/net/ethernet/ar231x/ar231x.c --- a/drivers/net/ethernet/ar231x/ar231x.c
+++ b/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);
BUG_ON(phydev->attached_dev); BUG_ON(phydev->attached_dev);

Loading…
Cancel
Save