Commit ba4d6513 authored by Lee Jones's avatar Lee Jones Committed by Kalle Valo
Browse files

airo: Fix a myriad of coding style issues



- Ensure spaces appear after {for, if, while, etc}
 - Ensure spaces to not appear after '('
 - Ensure spaces to not appear before ')'
 - Ensure spaces appear between ')' and '{'
 - Ensure spaces appear after ','
 - Ensure spaces do not appear before ','
 - Ensure spaces appear either side of '='
 - Ensure '{'s which open functions are on a new line
 - Remove trailing whitespace

There are still a whole host of issues with this file, but this
patch certainly breaks the back of them.

Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Benjamin Reed <breed@users.sourceforge.net>
Cc: Javier Achirica <achirica@users.sourceforge.net>
Cc: Jean Tourrilhes <jt@hpl.hp.com>
Cc: Fabrice Bellet <fabrice@bellet.info>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200814113933.1903438-13-lee.jones@linaro.org
parent 0b6a4247
Loading
Loading
Loading
Loading
+467 −430
Original line number Diff line number Diff line
@@ -1361,7 +1361,8 @@ static void micinit(struct airo_info *ai)

/* micsetup - Get ready for business */

static int micsetup(struct airo_info *ai) {
static int micsetup(struct airo_info *ai)
{
	int i;

	if (ai->tfm == NULL)
@@ -1871,7 +1872,8 @@ static void try_auto_wep(struct airo_info *ai)
	}
}

static int airo_open(struct net_device *dev) {
static int airo_open(struct net_device *dev)
{
	struct airo_info *ai = dev->ml_priv;
	int rc = 0;

@@ -2096,7 +2098,8 @@ static void get_tx_error(struct airo_info *ai, s32 fid)
	}
}

static void airo_end_xmit(struct net_device *dev) {
static void airo_end_xmit(struct net_device *dev)
{
	u16 status;
	int i;
	struct airo_info *priv = dev->ml_priv;
@@ -2167,7 +2170,8 @@ static netdev_tx_t airo_start_xmit(struct sk_buff *skb,
	return NETDEV_TX_OK;
}

static void airo_end_xmit11(struct net_device *dev) {
static void airo_end_xmit11(struct net_device *dev)
{
	u16 status;
	int i;
	struct airo_info *priv = dev->ml_priv;
@@ -2295,7 +2299,8 @@ static struct net_device_stats *airo_get_stats(struct net_device *dev)
	return &dev->stats;
}

static void airo_set_promisc(struct airo_info *ai) {
static void airo_set_promisc(struct airo_info *ai)
{
	Cmd cmd;
	Resp rsp;

@@ -2307,7 +2312,8 @@ static void airo_set_promisc(struct airo_info *ai) {
	up(&ai->sem);
}

static void airo_set_multicast_list(struct net_device *dev) {
static void airo_set_multicast_list(struct net_device *dev)
{
	struct airo_info *ai = dev->ml_priv;

	if ((dev->flags ^ ai->flags) & IFF_PROMISC) {
@@ -2357,7 +2363,8 @@ static void del_airo_dev(struct airo_info *ai)
		list_del(&ai->dev_list);
}

static int airo_close(struct net_device *dev) {
static int airo_close(struct net_device *dev)
{
	struct airo_info *ai = dev->ml_priv;

	netif_stop_queue(dev);
@@ -2703,7 +2710,8 @@ static struct net_device *init_wifidev(struct airo_info *ai,
	return dev;
}

static int reset_card( struct net_device *dev , int lock) {
static int reset_card(struct net_device *dev, int lock)
{
	struct airo_info *ai = dev->ml_priv;

	if (lock && down_interruptible(&ai->sem))
@@ -2946,7 +2954,8 @@ struct net_device *init_airo_card( unsigned short irq, int port, int is_pcmcia,

EXPORT_SYMBOL(init_airo_card);

static int waitbusy (struct airo_info *ai) {
static int waitbusy (struct airo_info *ai)
{
	int delay = 0;
	while ((IN4500(ai, COMMAND) & COMMAND_BUSY) && (delay < 10000)) {
		udelay (10);
@@ -2981,7 +2990,8 @@ int reset_airo_card( struct net_device *dev )

EXPORT_SYMBOL(reset_airo_card);

static void airo_send_event(struct net_device *dev) {
static void airo_send_event(struct net_device *dev)
{
	struct airo_info *ai = dev->ml_priv;
	union iwreq_data wrqu;
	StatusRid status_rid;
@@ -2998,7 +3008,8 @@ static void airo_send_event(struct net_device *dev) {
	wireless_send_event(dev, SIOCGIWAP, &wrqu, NULL);
}

static void airo_process_scan_results (struct airo_info *ai) {
static void airo_process_scan_results (struct airo_info *ai)
{
	union iwreq_data	wrqu;
	BSSListRid bss;
	int rc;
@@ -3062,7 +3073,8 @@ out:
	wireless_send_event(ai->dev, SIOCGIWSCAN, &wrqu, NULL);
}

static int airo_thread(void *data) {
static int airo_thread(void *data)
{
	struct net_device *dev = data;
	struct airo_info *ai = dev->ml_priv;
	int locked;
@@ -3547,7 +3559,8 @@ static irqreturn_t airo_interrupt(int irq, void *dev_id)
 *  NOTE:  If use with 8bit mode and SMP bad things will happen!
 *         Why would some one do 8 bit IO in an SMP machine?!?
 */
static void OUT4500( struct airo_info *ai, u16 reg, u16 val ) {
static void OUT4500(struct airo_info *ai, u16 reg, u16 val)
{
	if (test_bit(FLAG_MPI,&ai->flags))
		reg <<= 1;
	if (!do8bitIO)
@@ -3558,7 +3571,8 @@ static void OUT4500( struct airo_info *ai, u16 reg, u16 val ) {
	}
}

static u16 IN4500( struct airo_info *ai, u16 reg ) {
static u16 IN4500(struct airo_info *ai, u16 reg)
{
	unsigned short rc;

	if (test_bit(FLAG_MPI,&ai->flags))
@@ -3611,7 +3625,8 @@ static int enable_MAC(struct airo_info *ai, int lock)
	return rc;
}

static void disable_MAC( struct airo_info *ai, int lock ) {
static void disable_MAC(struct airo_info *ai, int lock)
{
        Cmd cmd;
	Resp rsp;

@@ -3630,12 +3645,14 @@ static void disable_MAC( struct airo_info *ai, int lock ) {
		up(&ai->sem);
}

static void enable_interrupts( struct airo_info *ai ) {
static void enable_interrupts(struct airo_info *ai)
{
	/* Enable the interrupts */
	OUT4500(ai, EVINTEN, STATUS_INTS);
}

static void disable_interrupts( struct airo_info *ai ) {
static void disable_interrupts(struct airo_info *ai)
{
	OUT4500(ai, EVINTEN, 0);
}

@@ -3946,7 +3963,8 @@ static u16 setup_card(struct airo_info *ai, u8 *mac, int lock)
	return SUCCESS;
}

static u16 issuecommand(struct airo_info *ai, Cmd *pCmd, Resp *pRsp) {
static u16 issuecommand(struct airo_info *ai, Cmd *pCmd, Resp *pRsp)
{
        // Im really paranoid about letting it run forever!
	int max_tries = 600000;

@@ -4509,7 +4527,8 @@ struct proc_data {
};

static int setup_proc_entry(struct net_device *dev,
			     struct airo_info *apriv ) {
			     struct airo_info *apriv)
{
	struct proc_dir_entry *entry;

	/* First setup the device directory */
@@ -4707,14 +4726,16 @@ static int proc_status_open(struct inode *inode, struct file *file)

static int proc_stats_rid_open(struct inode*, struct file*, u16);
static int proc_statsdelta_open(struct inode *inode,
				 struct file *file ) {
				 struct file *file)
{
	if (file->f_mode&FMODE_WRITE) {
		return proc_stats_rid_open(inode, file, RID_STATSDELTACLEAR);
	}
	return proc_stats_rid_open(inode, file, RID_STATSDELTA);
}

static int proc_stats_open( struct inode *inode, struct file *file ) {
static int proc_stats_open(struct inode *inode, struct file *file)
{
	return proc_stats_rid_open(inode, file, RID_STATS);
}

@@ -4759,7 +4780,8 @@ static int proc_stats_rid_open( struct inode *inode,
	return 0;
}

static int get_dec_u16( char *buffer, int *start, int limit ) {
static int get_dec_u16(char *buffer, int *start, int limit)
{
	u16 value;
	int valid = 0;
	for (value = 0; *start < limit && buffer[*start] >= '0' &&
@@ -5119,7 +5141,8 @@ static void proc_SSID_on_close(struct inode *inode, struct file *file)
	enable_MAC(ai, 1);
}

static void proc_APList_on_close( struct inode *inode, struct file *file ) {
static void proc_APList_on_close(struct inode *inode, struct file *file)
{
	struct proc_data *data = file->private_data;
	struct net_device *dev = PDE_DATA(inode);
	struct airo_info *ai = dev->ml_priv;
@@ -5141,7 +5164,8 @@ static void proc_APList_on_close( struct inode *inode, struct file *file ) {

/* This function wraps PC4500_writerid with a MAC disable */
static int do_writerid(struct airo_info *ai, u16 rid, const void *rid_data,
			int len, int dummy ) {
			int len, int dummy)
{
	int rc;

	disable_MAC(ai, 1);
@@ -5241,7 +5265,8 @@ static int set_wep_tx_idx(struct airo_info *ai, u16 index, int perm, int lock)
	return rc;
}

static void proc_wepkey_on_close( struct inode *inode, struct file *file ) {
static void proc_wepkey_on_close(struct inode *inode, struct file *file)
{
	struct proc_data *data;
	struct net_device *dev = PDE_DATA(inode);
	struct airo_info *ai = dev->ml_priv;
@@ -5383,7 +5408,8 @@ static int proc_SSID_open(struct inode *inode, struct file *file)
	return 0;
}

static int proc_APList_open( struct inode *inode, struct file *file ) {
static int proc_APList_open(struct inode *inode, struct file *file)
{
	struct proc_data *data;
	struct net_device *dev = PDE_DATA(inode);
	struct airo_info *ai = dev->ml_priv;
@@ -5421,7 +5447,8 @@ static int proc_APList_open( struct inode *inode, struct file *file ) {
	return 0;
}

static int proc_BSSList_open( struct inode *inode, struct file *file ) {
static int proc_BSSList_open(struct inode *inode, struct file *file)
{
	struct proc_data *data;
	struct net_device *dev = PDE_DATA(inode);
	struct airo_info *ai = dev->ml_priv;
@@ -5508,7 +5535,8 @@ static int proc_close( struct inode *inode, struct file *file )
   will switch WEP modes to see if that will help.  If the card is
   associated we will check every minute to see if anything has
   changed. */
static void timer_func( struct net_device *dev ) {
static void timer_func(struct net_device *dev)
{
	struct airo_info *apriv = dev->ml_priv;

/* We don't have a link so try changing the authtype */
@@ -7771,7 +7799,8 @@ static struct iw_statistics *airo_get_wireless_stats(struct net_device *dev)
 * as needed.  This represents the READ side of control I/O to
 * the card
 */
static int readrids(struct net_device *dev, aironet_ioctl *comp) {
static int readrids(struct net_device *dev, aironet_ioctl *comp)
{
	unsigned short ridcode;
	unsigned char *iobuf;
	int len;
@@ -7837,7 +7866,8 @@ static int readrids(struct net_device *dev, aironet_ioctl *comp) {
 * Danger Will Robinson write the rids here
 */

static int writerids(struct net_device *dev, aironet_ioctl *comp) {
static int writerids(struct net_device *dev, aironet_ioctl *comp)
{
	struct airo_info *ai = dev->ml_priv;
	int  ridcode;
        int  enabled;
@@ -7951,7 +7981,8 @@ static int writerids(struct net_device *dev, aironet_ioctl *comp) {
 * Flash command switch table
 */

static int flashcard(struct net_device *dev, aironet_ioctl *comp) {
static int flashcard(struct net_device *dev, aironet_ioctl *comp)
{
	int z;

	/* Only super-user can modify flash */
@@ -8010,7 +8041,8 @@ static int flashcard(struct net_device *dev, aironet_ioctl *comp) {
 * card.
 */

static int cmdreset(struct airo_info *ai) {
static int cmdreset(struct airo_info *ai)
{
	disable_MAC(ai, 1);

	if (!waitbusy (ai)) {
@@ -8034,7 +8066,8 @@ static int cmdreset(struct airo_info *ai) {
 * mode
 */

static int setflashmode (struct airo_info *ai) {
static int setflashmode (struct airo_info *ai)
{
	set_bit (FLAG_FLASHING, &ai->flags);

	OUT4500(ai, SWS0, FLASH_COMMAND);
@@ -8061,7 +8094,8 @@ static int setflashmode (struct airo_info *ai) {
 * x 50us for  echo .
 */

static int flashpchar(struct airo_info *ai,int byte,int dwelltime) {
static int flashpchar(struct airo_info *ai, int byte, int dwelltime)
{
	int echo;
	int waittime;

@@ -8101,7 +8135,8 @@ static int flashpchar(struct airo_info *ai,int byte,int dwelltime) {
 * Get a character from the card matching matchbyte
 * Step 3)
 */
static int flashgchar(struct airo_info *ai,int matchbyte,int dwelltime){
static int flashgchar(struct airo_info *ai, int matchbyte, int dwelltime)
{
	int           rchar;
	unsigned char rbyte = 0;

@@ -8132,7 +8167,8 @@ static int flashgchar(struct airo_info *ai,int matchbyte,int dwelltime){
 * send to the card
 */

static int flashputbuf(struct airo_info *ai){
static int flashputbuf(struct airo_info *ai)
{
	int            nwords;

	/* Write stuff */
@@ -8154,7 +8190,8 @@ static int flashputbuf(struct airo_info *ai){
/*
 *
 */
static int flashrestart(struct airo_info *ai,struct net_device *dev){
static int flashrestart(struct airo_info *ai, struct net_device *dev)
{
	int    i, status;

	ssleep(1);			/* Added 12/7/00 */