From: Felix Fietkau Date: Tue, 10 Jun 2014 09:06:06 +0000 (+0000) Subject: atheros: spaces fixes X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0bca3f9547a32788f8c5f18f229b3d09e81a7617;p=librecmc%2Flibrecmc.git atheros: spaces fixes Add missed spaces and remove odd space as suggested by checkpatch. Signed-off-by: Sergey Ryazanov SVN-Revision: 41091 --- diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index ee60b525f9..33c7ce56da 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -213,7 +213,7 @@ + radio_config = 0; + } + -+ return (u8 *) radio_config; ++ return radio_config; +} + +int __init @@ -248,7 +248,7 @@ + } + + board_data = kzalloc(BOARD_CONFIG_BUFSZ, GFP_KERNEL); -+ ar231x_board.config = (struct ar231x_boarddata *) board_data; ++ ar231x_board.config = (struct ar231x_boarddata *)board_data; + memcpy(board_data, bcfg, 0x100); + if (broken_boarddata) { + pr_warn("WARNING: broken board data detected\n"); @@ -269,7 +269,7 @@ + * of what the physical layout on the flash chip looks like */ + + if (ar231x_board.radio) -+ rcfg = (u8 *) ar231x_board.radio; ++ rcfg = (u8 *)ar231x_board.radio; + else + rcfg = find_radio_config(flash_limit, bcfg); + @@ -1818,13 +1818,13 @@ + +static const struct gpio_led_platform_data ar5312_led_data = { + .num_leds = ARRAY_SIZE(ar5312_leds), -+ .leds = (void *) ar5312_leds, ++ .leds = (void *)ar5312_leds, +}; + +static struct platform_device ar5312_gpio_leds = { + .name = "leds-gpio", + .id = -1, -+ .dev.platform_data = (void *) &ar5312_led_data, ++ .dev.platform_data = (void *)&ar5312_led_data, +}; +#endif + @@ -1857,7 +1857,7 @@ + ar231x_write_reg(AR531X_FLASHCTL2, + ar231x_read_reg(AR531X_FLASHCTL2) & ~(FLASHCTL_E | FLASHCTL_AC)); + -+ return (char *) KSEG1ADDR(AR531X_FLASH + 0x800000); ++ return (char *)KSEG1ADDR(AR531X_FLASH + 0x800000); +} + +int __init ar5312_init_devices(void) @@ -1916,7 +1916,7 @@ + c--; + } + -+ switch(ar231x_devtype) { ++ switch (ar231x_devtype) { + case DEV_TYPE_AR5312: + ar5312_eth0_data.macaddr = config->enet0_mac; + ar231x_add_ethernet(0, KSEG1ADDR(AR531X_ENET0), @@ -2258,7 +2258,7 @@ + unsigned int imr; + + imr = ar231x_read_reg(AR2315_IMR); -+ switch(d->irq) { ++ switch (d->irq) { + case AR531X_MISC_IRQ_SPI: + imr |= AR2315_ISR_SPI; + break; @@ -2289,7 +2289,7 @@ + unsigned int imr; + + imr = ar231x_read_reg(AR2315_IMR); -+ switch(d->irq) { ++ switch (d->irq) { + case AR531X_MISC_IRQ_SPI: + imr &= ~AR2315_ISR_SPI; + break; @@ -2581,20 +2581,20 @@ + + ar2315_spiflash_res[0].end = ar2315_spiflash_res[0].start + + flash_size - 1; -+ return (u8 *) ar2315_spiflash_res[0].end + 1; ++ return (u8 *)ar2315_spiflash_res[0].end + 1; +} + +#ifdef CONFIG_LEDS_GPIO +static struct gpio_led ar2315_leds[6]; +static struct gpio_led_platform_data ar2315_led_data = { -+ .leds = (void *) ar2315_leds, ++ .leds = (void *)ar2315_leds, +}; + +static struct platform_device ar2315_gpio_leds = { + .name = "leds-gpio", + .id = -1, + .dev = { -+ .platform_data = (void *) &ar2315_led_data, ++ .platform_data = (void *)&ar2315_led_data, + } +}; + @@ -2606,8 +2606,8 @@ + + ar2315_led_data.num_leds = 0; + for (i = 1; i < 8; i++) { -+ if((i == AR2315_RESET_GPIO) || -+ (i == ar231x_board.config->reset_config_gpio)) ++ if ((i == AR2315_RESET_GPIO) || ++ (i == ar231x_board.config->reset_config_gpio)) + continue; + + if (i == ar231x_board.config->sys_led_gpio) @@ -2652,12 +2652,12 @@ +static void +ar2315_restart(char *command) +{ -+ void (*mips_reset_vec)(void) = (void *) 0xbfc00000; ++ void (*mips_reset_vec)(void) = (void *)0xbfc00000; + + local_irq_disable(); + + /* try reset the system via reset control */ -+ ar231x_write_reg(AR2315_COLD_RESET,AR2317_RESET_SYSTEM); ++ ar231x_write_reg(AR2315_COLD_RESET, AR2317_RESET_SYSTEM); + + /* Cold reset does not work on the AR2315/6, use the GPIO reset bits a workaround. + * give it some time to attempt a gpio based hardware reset @@ -2797,7 +2797,7 @@ + /* Clear any lingering AHB errors */ + config = read_c0_config(); + write_c0_config(config & ~0x3); -+ ar231x_write_reg(AR2315_AHB_ERR0,AHB_ERROR_DET); ++ ar231x_write_reg(AR2315_AHB_ERR0, AHB_ERROR_DET); + ar231x_read_reg(AR2315_AHB_ERR1); + ar231x_write_reg(AR2315_WDC, AR2315_WDC_IGNORE_EXPIRATION); + @@ -2922,13 +2922,13 @@ +static inline u32 +ar231x_read_reg(u32 reg) +{ -+ return __raw_readl((u32 *) KSEG1ADDR(reg)); ++ return __raw_readl((u32 *)KSEG1ADDR(reg)); +} + +static inline void +ar231x_write_reg(u32 reg, u32 val) +{ -+ __raw_writel(val, (u32 *) KSEG1ADDR(reg)); ++ __raw_writel(val, (u32 *)KSEG1ADDR(reg)); +} + +static inline u32 diff --git a/target/linux/atheros/patches-3.10/105-ar2315_pci.patch b/target/linux/atheros/patches-3.10/105-ar2315_pci.patch index af4bb88867..2f3f8098ce 100644 --- a/target/linux/atheros/patches-3.10/105-ar2315_pci.patch +++ b/target/linux/atheros/patches-3.10/105-ar2315_pci.patch @@ -7,7 +7,7 @@ +obj-$(CONFIG_ATHEROS_AR2315_PCI) += pci.o --- /dev/null +++ b/arch/mips/ar231x/pci.c -@@ -0,0 +1,228 @@ +@@ -0,0 +1,229 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License @@ -71,18 +71,18 @@ + if (write) { + value = *ptr; + if (size == 1) -+ err = put_dbe(value, (u8 *) addr); ++ err = put_dbe(value, (u8 *)addr); + else if (size == 2) -+ err = put_dbe(value, (u16 *) addr); ++ err = put_dbe(value, (u16 *)addr); + else if (size == 4) -+ err = put_dbe(value, (u32 *) addr); ++ err = put_dbe(value, (u32 *)addr); + } else { + if (size == 1) -+ err = get_dbe(value, (u8 *) addr); ++ err = get_dbe(value, (u8 *)addr); + else if (size == 2) -+ err = get_dbe(value, (u16 *) addr); ++ err = get_dbe(value, (u16 *)addr); + else if (size == 4) -+ err = get_dbe(value, (u32 *) addr); ++ err = get_dbe(value, (u32 *)addr); + if (err) + *ptr = 0xffffffff; + else @@ -96,7 +96,8 @@ + return err ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL; +} + -+static int ar231x_pci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 * value) ++static int ar231x_pci_read(struct pci_bus *bus, unsigned int devfn, int where, ++ int size, u32 *value) +{ + return config_access(devfn, where, size, value, 0); +} diff --git a/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch b/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch index 128f470ac6..1fc4eb49d3 100644 --- a/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch +++ b/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch @@ -49,8 +49,8 @@ + * (at your option) any later version. + * + * Additional credits: -+ * This code is taken from John Taylor's Sibyte driver and then -+ * modified for the AR2313. ++ * This code is taken from John Taylor's Sibyte driver and then ++ * modified for the AR2313. + */ + +#include @@ -88,7 +88,7 @@ + + +#ifndef min -+#define min(a,b) (((a)<(b))?(a):(b)) ++#define min(a, b) (((a) < (b)) ? (a) : (b)) +#endif + +#ifndef SMP_CACHE_BYTES @@ -179,7 +179,7 @@ +static int ar231x_mdiobus_read(struct mii_bus *bus, int phy_addr, int regnum); +static int ar231x_mdiobus_write(struct mii_bus *bus, int phy_addr, int regnum, u16 value); +static int ar231x_mdiobus_reset(struct mii_bus *bus); -+static int ar231x_mdiobus_probe (struct net_device *dev); ++static int ar231x_mdiobus_probe(struct net_device *dev); +static void ar231x_adjust_link(struct net_device *dev); + +#ifndef ERR @@ -423,7 +423,7 @@ +{ + struct ar231x_private *sp = netdev_priv(dev); + if (sp->rx_ring != NULL) { -+ kfree((void *) KSEG0ADDR(sp->rx_ring)); ++ kfree((void *)KSEG0ADDR(sp->rx_ring)); + sp->rx_ring = NULL; + sp->tx_ring = NULL; + } @@ -452,9 +452,9 @@ + dma_cache_inv((unsigned int) space, size); + + /* now convert pointer to KSEG1 */ -+ space = (ar231x_descr_t *) KSEG1ADDR(space); ++ space = (ar231x_descr_t *)KSEG1ADDR(space); + -+ memset((void *) space, 0, size); ++ memset((void *)space, 0, size); + + sp->rx_ring = space; + space += AR2313_DESCR_ENTRIES; @@ -490,9 +490,9 @@ + ar231x_free_descriptors(dev); + + if (sp->eth_regs) -+ iounmap((void *) sp->eth_regs); ++ iounmap((void *)sp->eth_regs); + if (sp->dma_regs) -+ iounmap((void *) sp->dma_regs); ++ iounmap((void *)sp->dma_regs); + + if (sp->rx_skb) { + for (j = 0; j < AR2313_DESCR_ENTRIES; j++) { @@ -535,7 +535,7 @@ + +static void ar231x_link_timer_fn(unsigned long data) +{ -+ struct net_device *dev = (struct net_device *) data; ++ struct net_device *dev = (struct net_device *)data; + struct ar231x_private *sp = netdev_priv(dev); + + /** @@ -781,7 +781,7 @@ + skb->dev = dev; + sp->rx_skb[idx] = skb; + -+ rd = (ar231x_descr_t *) & sp->rx_ring[idx]; ++ rd = (ar231x_descr_t *)&sp->rx_ring[idx]; + + /* initialize dma descriptor */ + rd->devcs = ((AR2313_BUFSIZE << DMA_RX1_BSIZE_SHIFT) | @@ -942,7 +942,7 @@ + +static void rx_tasklet_func(unsigned long data) +{ -+ struct net_device *dev = (struct net_device *) data; ++ struct net_device *dev = (struct net_device *)data; + struct ar231x_private *sp = netdev_priv(dev); + + if (sp->unloading) @@ -969,7 +969,7 @@ + +static irqreturn_t ar231x_interrupt(int irq, void *dev_id) +{ -+ struct net_device *dev = (struct net_device *) dev_id; ++ struct net_device *dev = (struct net_device *)dev_id; + struct ar231x_private *sp = netdev_priv(dev); + unsigned int status, enabled; + @@ -1149,7 +1149,7 @@ + switch (cmd) { + case SIOCETHTOOL: + 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); + spin_unlock_irq(&sp->lock); + return ret; + @@ -1235,7 +1235,7 @@ + return 0; +} + -+static int ar231x_mdiobus_probe (struct net_device *dev) ++static int ar231x_mdiobus_probe(struct net_device *dev) +{ + struct ar231x_private *const sp = netdev_priv(dev); + struct phy_device *phydev = NULL; @@ -1250,7 +1250,7 @@ + } + + if (!phydev) { -+ printk (KERN_ERR "ar231x: %s: no PHY found\n", dev->name); ++ printk(KERN_ERR "ar231x: %s: no PHY found\n", dev->name); + return -1; + } + diff --git a/target/linux/atheros/patches-3.10/120-spiflash.patch b/target/linux/atheros/patches-3.10/120-spiflash.patch index 4705d01cb7..a1b36ee37e 100644 --- a/target/linux/atheros/patches-3.10/120-spiflash.patch +++ b/target/linux/atheros/patches-3.10/120-spiflash.patch @@ -23,7 +23,7 @@ --- /dev/null +++ b/drivers/mtd/devices/ar2315.c -@@ -0,0 +1,515 @@ +@@ -0,0 +1,517 @@ + +/* + * MTD driver for the SPI Flash Memory support on Atheros AR2315 @@ -177,7 +177,7 @@ +} + +static u32 -+spiflash_sendcmd (struct spiflash_priv *priv, int opcode, u32 addr) ++spiflash_sendcmd(struct spiflash_priv *priv, int opcode, u32 addr) +{ + const struct opcodes *op; + u32 reg, mask; @@ -224,7 +224,7 @@ + * and flashconfig_tbl array index for success. + */ +static int -+spiflash_probe_chip (struct spiflash_priv *priv) ++spiflash_probe_chip(struct spiflash_priv *priv) +{ + u32 sig; + int flash_size; @@ -273,7 +273,7 @@ + schedule(); + remove_wait_queue(&priv->wq, &wait); + -+ if(signal_pending(current)) ++ if (signal_pending(current)) + return 0; + + goto retry; @@ -301,7 +301,7 @@ + + +static int -+spiflash_erase (struct mtd_info *mtd, struct erase_info *instr) ++spiflash_erase(struct mtd_info *mtd, struct erase_info *instr) +{ + struct spiflash_priv *priv = to_spiflash(mtd); + const struct opcodes *op; @@ -333,7 +333,8 @@ +} + +static int -+spiflash_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf) ++spiflash_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, ++ u_char *buf) +{ + struct spiflash_priv *priv = to_spiflash(mtd); + u8 *read_addr; @@ -357,7 +358,8 @@ +} + +static int -+spiflash_write (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u8 *buf) ++spiflash_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, ++ const u8 *buf) +{ + struct spiflash_priv *priv = to_spiflash(mtd); + u32 opcode, bytes_left; @@ -501,7 +503,7 @@ +} + +static int -+spiflash_remove (struct platform_device *pdev) ++spiflash_remove(struct platform_device *pdev) +{ + struct spiflash_priv *priv = platform_get_drvdata(pdev); + struct mtd_info *mtd = &priv->mtd; @@ -521,19 +523,19 @@ +}; + +int __init -+spiflash_init (void) ++spiflash_init(void) +{ + return platform_driver_register(&spiflash_driver); +} + +void __exit -+spiflash_exit (void) ++spiflash_exit(void) +{ + return platform_driver_unregister(&spiflash_driver); +} + -+module_init (spiflash_init); -+module_exit (spiflash_exit); ++module_init(spiflash_init); ++module_exit(spiflash_exit); + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("OpenWrt.org, Atheros Communications Inc"); diff --git a/target/linux/atheros/patches-3.10/130-watchdog.patch b/target/linux/atheros/patches-3.10/130-watchdog.patch index e2c9468545..2ae6dcc0f0 100644 --- a/target/linux/atheros/patches-3.10/130-watchdog.patch +++ b/target/linux/atheros/patches-3.10/130-watchdog.patch @@ -56,7 +56,7 @@ +static ssize_t +ar2315_wdt_write(struct file *file, const char __user *data, size_t len, loff_t *ppos) +{ -+ if(len) ++ if (len) + ar2315_wdt_enable(); + return len; +} @@ -64,7 +64,7 @@ +static int +ar2315_wdt_open(struct inode *inode, struct file *file) +{ -+ if(in_use) ++ if (in_use) + return -EBUSY; + ar2315_wdt_enable(); + in_use = started = 1; @@ -157,7 +157,7 @@ + } + + ret = misc_register(&ar2315_wdt_miscdev); -+ if(ret) ++ if (ret) + dev_err(&dev->dev, "failed to register miscdev\n"); + +out: @@ -185,7 +185,7 @@ +init_ar2315_wdt(void) +{ + int ret = platform_driver_register(&ar2315_wdt_driver); -+ if(ret) ++ if (ret) + pr_err("ar2315_wdt: error registering platfom driver!\n"); + return ret; +} diff --git a/target/linux/atheros/patches-3.10/140-redboot_boardconfig.patch b/target/linux/atheros/patches-3.10/140-redboot_boardconfig.patch index 3925b677c3..678d7ec3c3 100644 --- a/target/linux/atheros/patches-3.10/140-redboot_boardconfig.patch +++ b/target/linux/atheros/patches-3.10/140-redboot_boardconfig.patch @@ -38,7 +38,7 @@ } #endif for ( ; iimg->size; parts[i].offset = fl->img->flash_base; diff --git a/target/linux/atheros/patches-3.10/142-redboot_various_erase_size_fix.patch b/target/linux/atheros/patches-3.10/142-redboot_various_erase_size_fix.patch index d901b08ffe..55de500ea9 100644 --- a/target/linux/atheros/patches-3.10/142-redboot_various_erase_size_fix.patch +++ b/target/linux/atheros/patches-3.10/142-redboot_various_erase_size_fix.patch @@ -47,7 +47,7 @@ } #endif for ( ; iimg->size; parts[i].offset = fl->img->flash_base; diff --git a/target/linux/atheros/patches-3.10/220-enet_micrel_workaround.patch b/target/linux/atheros/patches-3.10/220-enet_micrel_workaround.patch index 5e7a66094b..66832d5dc6 100644 --- a/target/linux/atheros/patches-3.10/220-enet_micrel_workaround.patch +++ b/target/linux/atheros/patches-3.10/220-enet_micrel_workaround.patch @@ -2,7 +2,7 @@ +++ b/drivers/net/ethernet/ar231x/ar231x.c @@ -146,6 +146,7 @@ static int ar231x_mdiobus_write(struct m static int ar231x_mdiobus_reset(struct mii_bus *bus); - static int ar231x_mdiobus_probe (struct net_device *dev); + static int ar231x_mdiobus_probe(struct net_device *dev); static void ar231x_adjust_link(struct net_device *dev); +static bool no_phy; diff --git a/target/linux/atheros/patches-3.10/230-3_10-updates.patch b/target/linux/atheros/patches-3.10/230-3_10-updates.patch index dfaa346de9..8e4db175fe 100644 --- a/target/linux/atheros/patches-3.10/230-3_10-updates.patch +++ b/target/linux/atheros/patches-3.10/230-3_10-updates.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ethernet/ar231x/ar231x.c +++ b/drivers/net/ethernet/ar231x/ar231x.c -@@ -1272,7 +1272,7 @@ static int ar231x_mdiobus_probe (struct +@@ -1272,7 +1272,7 @@ static int ar231x_mdiobus_probe(struct n BUG_ON(!phydev); BUG_ON(phydev->attached_dev);