Small cleanups
Small whitespace cleanups for wireless drivers
---
commit ac537c3b8a8dda4adcbf7810c4b86474e054f48c
tree d638e3fbcb6d6c35109661f908d84cb81df95322
parent 7f80fda409c75b32b46a06b371fe504805188395
author Pavel <[email protected]> Wed, 25 Jun 2008 12:23:00 +0200 committer Pavel <[email protected]> Wed, 25 Jun 2008 12:23:00 +0200
drivers/net/wireless/airo.c | 41 +++++++++++++++++---------------------- drivers/net/wireless/ath5k/hw.c | 4 ++-- 2 files changed, 20 insertions(+), 25 deletions(-)
drivers/net/wireless/airo.c +18 -23
@@ -85,10 +85,10 @@ #endif /* CONFIG_PCI *//* Include Wireless Extension definition and check version - Jean II */ #include <linux/wireless.h> -#define WIRELESS_SPY // enable iwspy support -#include <net/iw_handler.h> // New driver API +#define WIRELESS_SPY /* enable iwspy support */ +#include <net/iw_handler.h> /* New driver API */ -#define CISCO_EXT // enable Cisco extensions +#define CISCO_EXT /* enable Cisco extensions */ #ifdef CISCO_EXT #include <linux/delay.h> #endif
@@ -281,7 +281,7 @@ MODULE_PARM_DESC(proc_perm, "The permiss/* This is a kind of sloppy hack to get this information to OUT4500 and IN4500. I would be extremely interested in the situation where this doesn't work though!!! */ -static int do8bitIO =0 ; +static int do8bitIO/* = 0 */ ;/* Return codes */ #define SUCCESS 0
@@ -398,8 +398,8 @@ #define RIDSIZE 2048#define MAXTXQ 64/* BAP selectors */ -#define BAP0 0 // Used for receiving packets -#define BAP1 2 // Used for xmiting packets and working with RIDS +#define BAP0 0/* Used for receiving packets */ +#define BAP1 2/* Used for xmiting packets and working with RIDS */ /* Flags */ #define COMMAND_BUSY 0x8000
@@ -5530,11 +5530,13 @@ static int airo_pci_suspend(struct pci_dCmd cmd;Resp rsp; -if ((ai->APList ==NULL ) && - (ai->APList =kmalloc (sizeof (APListRid),GFP_KERNEL )) ==NULL ) +if (!ai->APList) + ai->APList =kmalloc (sizeof (APListRid),GFP_KERNEL ); +if (!ai->APList)return -ENOMEM ; -if ((ai->SSID ==NULL ) && - (ai->SSID =kmalloc (sizeof (SsidRid),GFP_KERNEL )) ==NULL ) +if (!ai->SSID) + ai->SSID =kmalloc (sizeof (SsidRid),GFP_KERNEL ); +if (!ai->SSID)return -ENOMEM ;readAPListRid (ai, ai->APList);readSsidRid (ai, ai->SSID);
@@ -5545,7 +5547,7 @@ static int airo_pci_suspend(struct pci_ddisable_MAC (ai,0 );netif_device_detach (dev); ai->power = state; - cmd.cmd=HOSTSLEEP ; + cmd.cmd =HOSTSLEEP ;issuecommand (ai, &cmd, &rsp);pci_enable_wake (pdev,pci_choose_state (pdev, state),1 );
@@ -5575,7 +5577,7 @@ static int airo_pci_resume(struct pci_demsleep (100 ); } -set_bit (FLAG_COMMIT , &ai->flags); +set_bit (FLAG_COMMIT , &ai->flags);disable_MAC (ai,0 );msleep (200 );if (ai->SSID) {
@@ -5602,9 +5604,6 @@ #endifstatic int __init airo_init_module (void ) {int i; -#if 0 -int have_isa_dev =0 ; -#endif airo_entry = create_proc_entry("driver/aironet", S_IFDIR | airo_perm,
@@ -5615,15 +5614,11 @@ #endif airo_entry->gid = proc_gid; } -for ( i =0 ; i <4 && io[i] && irq[i]; i++ ) { +for (i =0 ; i <4 && io[i] && irq[i]; i++) {airo_print_info ("" ,"Trying to configure ISA adapter at irq=%d " "io=0x%x" , irq[i], io[i] );if (init_airo_card ( irq[i], io[i],0 ,NULL )) -#if 0 - have_isa_dev =1 ; -#else /* do nothing */ ; -#endif }#ifdef CONFIG_PCI
@@ -5669,7 +5664,7 @@ #endifstatic u8 airo_rssi_to_dbm (tdsRssiEntry *rssi_rid,u8 rssi) { -if ( !rssi_rid ) +if (!rssi_rid)return 0 ;return (0x100 - rssi_rid[rssi].rssidBm);
@@ -5679,10 +5674,10 @@ static u8 airo_dbm_to_pct (tdsRssiEntry {int i; -if ( !rssi_rid ) +if (!rssi_rid)return 0 ; -for ( i =0 ; i <256 ; i++ ) +for (i =0 ; i <256 ; i++)if (rssi_rid[i].rssidBm == dbm)return rssi_rid[i].rssipct;
drivers/net/wireless/ath5k/hw.c +2 -2
@@ -31,14 +31,14 @@ #include "reg.h"#include "base.h" #include "debug.h" -/*Rate tables*/ +/* Rate tables */ static const struct ath5k_rate_table ath5k_rt_11a =AR5K_RATES_11A ;static const struct ath5k_rate_table ath5k_rt_11b =AR5K_RATES_11B ;static const struct ath5k_rate_table ath5k_rt_11g =AR5K_RATES_11G ;static const struct ath5k_rate_table ath5k_rt_turbo =AR5K_RATES_TURBO ;static const struct ath5k_rate_table ath5k_rt_xr =AR5K_RATES_XR ; -/*Prototypes*/ +/* Prototypes */ static int ath5k_hw_nic_reset (struct ath5k_hw *,u32 );static int ath5k_hw_nic_wakeup (struct ath5k_hw *,int ,bool ); static int ath5k_hw_setup_4word_tx_desc(struct ath5k_hw *, struct ath5k_desc *,
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Jiri Slaby
Acked-byPavel Machek napsal(a):
Quoted 3 lines
Small whitespace cleanups for wireless drivers
Signed-off-by Pavel Machek <[email protected]>
The ath5k part
Thanks!
Quoted 4 lines
drivers/net/wireless/airo.c +0
-0
[...]
Quoted 6 lines
drivers/net/wireless/airo.c +0
-2@@ -5530,11 +5530,13 @@ static int airo_pci_suspend(struct pci_dCmd cmd;Resp rsp; -if ((ai->APList ==NULL ) && - (ai->APList =kmalloc (sizeof (APListRid),GFP_KERNEL )) ==NULL )
drivers/net/wireless/airo.c static int airo_pci_suspend(struct pci_d · line 5540
Quoted 10 lines
drivers/net/wireless/airo.c +6
-2+if (!ai->APList) + ai->APList =kmalloc (sizeof (APListRid),GFP_KERNEL ); +if (!ai->APList)return -ENOMEM ; -if ((ai->SSID ==NULL ) && - (ai->SSID =kmalloc (sizeof (SsidRid),GFP_KERNEL )) ==NULL ) +if (!ai->SSID) + ai->SSID =kmalloc (sizeof (SsidRid),GFP_KERNEL ); +if (!ai->SSID)return -ENOMEM ;
Would you mind sending another patch which would fix the potential leak?
Quoted 4 lines
drivers/net/wireless/airo.c +0
-0@@ -5615,15 +5614,11 @@ #endif airo_entry->gid = proc_gid; }
drivers/net/wireless/airo.c #endif · line 5626
Quoted 10 lines
drivers/net/wireless/airo.c +1
-5-for ( i =0 ; i <4 && io[i] && irq[i]; i++ ) { +for (i =0 ; i <4 && io[i] && irq[i]; i++) {airo_print_info ("" ,"Trying to configure ISA adapter at irq=%d " "io=0x%x" , irq[i], io[i] );if (init_airo_card ( irq[i], io[i],0 ,NULL )) -#if 0 - have_isa_dev =1 ; -#else /* do nothing */ ; -#endif
Why not just remove the if?
Quoted 3 lines
drivers/net/wireless/airo.c +0
-0}#ifdef CONFIG_PCI
Quoted 13 lines
drivers/net/wireless/airo.c static int airo_pci_suspend(struct pci_d · line 5540
Quoted 12 lines
drivers/net/wireless/airo.c +6
-4-if ((ai->APList ==NULL ) && - (ai->APList =kmalloc (sizeof (APListRid),GFP_KERNEL )) ==NULL ) +if (!ai->APList) + ai->APList =kmalloc (sizeof (APListRid),GFP_KERNEL ); +if (!ai->APList)return -ENOMEM ; -if ((ai->SSID ==NULL ) && - (ai->SSID =kmalloc (sizeof (SsidRid),GFP_KERNEL )) ==NULL ) +if (!ai->SSID) + ai->SSID =kmalloc (sizeof (SsidRid),GFP_KERNEL ); +if (!ai->SSID)return -ENOMEM ;
Quoted 1 line
Would you mind sending another patch which would fix the potential leak?
Sorry, ignore this.