Archived
14
0
Fork 0

Staging: wlan-ng - checkpatch.pl fixups

Basic fixups in the staging/wlan-ng directory.
(First kernel patch - thanks to FOSDEM talk)

Signed-off-by: Andrew Elwell <Andrew.Elwell@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Andrew Elwell 2010-02-18 23:56:12 +01:00 committed by Greg Kroah-Hartman
parent 6705b68d0b
commit ef1a0ed7f1
15 changed files with 182 additions and 193 deletions

View file

@ -118,10 +118,10 @@
#include <linux/wireless.h> #include <linux/wireless.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <asm/io.h> #include <linux/io.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <asm/bitops.h> #include <linux/bitops.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/usb.h> #include <linux/usb.h>
#include <linux/byteorder/generic.h> #include <linux/byteorder/generic.h>
@ -3642,7 +3642,7 @@ static void hfa384x_int_rxmonitor(wlandevice_t *wlandev,
/* check for unencrypted stuff if WEP bit set. */ /* check for unencrypted stuff if WEP bit set. */
if (*(datap - hdrlen + 1) & 0x40) /* wep set */ if (*(datap - hdrlen + 1) & 0x40) /* wep set */
if ((*(datap) == 0xaa) && (*(datap + 1) == 0xaa)) if ((*(datap) == 0xaa) && (*(datap + 1) == 0xaa))
*(datap - hdrlen + 1) &= 0xbf; // clear wep; it's the 802.2 header! *(datap - hdrlen + 1) &= 0xbf; /* clear wep; it's the 802.2 header! */
} }
if (hw->sniff_fcs) { if (hw->sniff_fcs) {

View file

@ -46,8 +46,8 @@
#include <linux/wireless.h> #include <linux/wireless.h>
#include <net/iw_handler.h> #include <net/iw_handler.h>
#include <linux/if_arp.h> #include <linux/if_arp.h>
#include <asm/bitops.h> #include <linux/bitops.h>
#include <asm/uaccess.h> #include <linux/uaccess.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <linux/if_ether.h> #include <linux/if_ether.h>
#include <linux/bitops.h> #include <linux/bitops.h>

View file

@ -264,7 +264,7 @@ int prism2_fwapply(const struct ihex_binrec *rfptr, wlandevice_t *wlandev)
/* Build the PDA we're going to use. */ /* Build the PDA we're going to use. */
if (read_cardpda(&pda, wlandev)) { if (read_cardpda(&pda, wlandev)) {
printk(KERN_ERR "load_cardpda failed, exiting.\n"); printk(KERN_ERR "load_cardpda failed, exiting.\n");
return (1); return 1;
} }
/* read the card's PRI-SUP */ /* read the card's PRI-SUP */
@ -286,9 +286,8 @@ int prism2_fwapply(const struct ihex_binrec *rfptr, wlandevice_t *wlandev)
/* DIDmsg_dot11req_mibget */ /* DIDmsg_dot11req_mibget */
prism2mgmt_mibset_mibget(wlandev, &getmsg); prism2mgmt_mibset_mibget(wlandev, &getmsg);
if (getmsg.resultcode.data != P80211ENUM_resultcode_success) { if (getmsg.resultcode.data != P80211ENUM_resultcode_success)
printk(KERN_ERR "Couldn't fetch PRI-SUP info\n"); printk(KERN_ERR "Couldn't fetch PRI-SUP info\n");
}
/* Already in host order */ /* Already in host order */
priid.role = *data++; priid.role = *data++;
@ -301,19 +300,19 @@ int prism2_fwapply(const struct ihex_binrec *rfptr, wlandevice_t *wlandev)
result = read_fwfile(rfptr); result = read_fwfile(rfptr);
if (result) { if (result) {
printk(KERN_ERR "Failed to read the data exiting.\n"); printk(KERN_ERR "Failed to read the data exiting.\n");
return (1); return 1;
} }
result = validate_identity(); result = validate_identity();
if (result) { if (result) {
printk(KERN_ERR "Incompatible firmware image.\n"); printk(KERN_ERR "Incompatible firmware image.\n");
return (1); return 1;
} }
if (startaddr == 0x00000000) { if (startaddr == 0x00000000) {
printk(KERN_ERR "Can't RAM download a Flash image!\n"); printk(KERN_ERR "Can't RAM download a Flash image!\n");
return (1); return 1;
} }
/* Make the image chunks */ /* Make the image chunks */
@ -323,20 +322,20 @@ int prism2_fwapply(const struct ihex_binrec *rfptr, wlandevice_t *wlandev)
result = plugimage(fchunk, nfchunks, s3plug, ns3plug, &pda); result = plugimage(fchunk, nfchunks, s3plug, ns3plug, &pda);
if (result) { if (result) {
printk(KERN_ERR "Failed to plug data.\n"); printk(KERN_ERR "Failed to plug data.\n");
return (1); return 1;
} }
/* Insert any CRCs */ /* Insert any CRCs */
if (crcimage(fchunk, nfchunks, s3crc, ns3crc)) { if (crcimage(fchunk, nfchunks, s3crc, ns3crc)) {
printk(KERN_ERR "Failed to insert all CRCs\n"); printk(KERN_ERR "Failed to insert all CRCs\n");
return (1); return 1;
} }
/* Write the image */ /* Write the image */
result = writeimage(wlandev, fchunk, nfchunks); result = writeimage(wlandev, fchunk, nfchunks);
if (result) { if (result) {
printk(KERN_ERR "Failed to ramwrite image data.\n"); printk(KERN_ERR "Failed to ramwrite image data.\n");
return (1); return 1;
} }
/* clear any allocated memory */ /* clear any allocated memory */
@ -434,10 +433,9 @@ void free_chunks(imgchunk_t *fchunk, unsigned int *nfchunks)
{ {
int i; int i;
for (i = 0; i < *nfchunks; i++) { for (i = 0; i < *nfchunks; i++) {
if (fchunk[i].data != NULL) { if (fchunk[i].data != NULL)
kfree(fchunk[i].data); kfree(fchunk[i].data);
} }
}
*nfchunks = 0; *nfchunks = 0;
memset(fchunk, 0, sizeof(*fchunk)); memset(fchunk, 0, sizeof(*fchunk));
@ -531,7 +529,7 @@ int mkimage(imgchunk_t *clist, unsigned int *ccnt)
if (clist[i].data == NULL) { if (clist[i].data == NULL) {
printk(KERN_ERR printk(KERN_ERR
"failed to allocate image space, exitting.\n"); "failed to allocate image space, exitting.\n");
return (1); return 1;
} }
memset(clist[i].data, 0, clist[i].len); memset(clist[i].data, 0, clist[i].len);
pr_debug("chunk[%d]: addr=0x%06x len=%d\n", pr_debug("chunk[%d]: addr=0x%06x len=%d\n",
@ -545,15 +543,14 @@ int mkimage(imgchunk_t *clist, unsigned int *ccnt)
for (j = 0; j < *ccnt; j++) { for (j = 0; j < *ccnt; j++) {
cstart = clist[j].addr; cstart = clist[j].addr;
cend = cstart + clist[j].len - 1; cend = cstart + clist[j].len - 1;
if (s3start >= cstart && s3end <= cend) { if (s3start >= cstart && s3end <= cend)
break; break;
} }
}
if (((unsigned int)j) >= (*ccnt)) { if (((unsigned int)j) >= (*ccnt)) {
printk(KERN_ERR printk(KERN_ERR
"s3rec(a=0x%06x,l=%d), no chunk match, exiting.\n", "s3rec(a=0x%06x,l=%d), no chunk match, exiting.\n",
s3start, s3data[i].len); s3start, s3data[i].len);
return (1); return 1;
} }
coffset = s3start - cstart; coffset = s3start - cstart;
memcpy(clist[j].data + coffset, s3data[i].data, s3data[i].len); memcpy(clist[j].data + coffset, s3data[i].data, s3data[i].len);
@ -623,7 +620,7 @@ int mkpdrlist(pda_t *pda)
printk(KERN_ERR printk(KERN_ERR
"no end record found or invalid lengths in " "no end record found or invalid lengths in "
"PDR data, exiting. %x %d\n", curroff, pda->nrec); "PDR data, exiting. %x %d\n", curroff, pda->nrec);
return (1); return 1;
} }
if (le16_to_cpu(pda16[curroff + 1]) == HFA384x_PDR_END_OF_PDA) { if (le16_to_cpu(pda16[curroff + 1]) == HFA384x_PDR_END_OF_PDA) {
pda->rec[pda->nrec] = (hfa384x_pdrec_t *) &(pda16[curroff]); pda->rec[pda->nrec] = (hfa384x_pdrec_t *) &(pda16[curroff]);
@ -1160,10 +1157,7 @@ int validate_identity(void)
} }
/* SEC compat range */ /* SEC compat range */
if ((s3info[i].info.compat.role == 1) && if ((s3info[i].info.compat.role == 1) &&
(s3info[i].info.compat.id == 4)) { (s3info[i].info.compat.id == 4))
}
break; break;
case 3: case 3:
pr_debug("Seq: %#x\n", s3info[i].info.buildseq); pr_debug("Seq: %#x\n", s3info[i].info.buildseq);
@ -1196,8 +1190,9 @@ int validate_identity(void)
pr_debug("Unknown inforec type %d\n", s3info[i].type); pr_debug("Unknown inforec type %d\n", s3info[i].type);
} }
} }
// walk through /* walk through */
if (trump && (result != 2)) result = 0; if (trump && (result != 2))
result = 0;
return result; return result;
} }

View file

@ -67,7 +67,7 @@
#include <linux/wireless.h> #include <linux/wireless.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <asm/io.h> #include <linux/io.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <linux/random.h> #include <linux/random.h>
#include <linux/usb.h> #include <linux/usb.h>
@ -1157,9 +1157,7 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
/* Save macport 0 state */ /* Save macport 0 state */
result = hfa384x_drvr_getconfig16(hw, result = hfa384x_drvr_getconfig16(hw,
HFA384x_RID_CNFPORTTYPE, HFA384x_RID_CNFPORTTYPE,
& &(hw->presniff_port_type));
(hw->
presniff_port_type));
if (result) { if (result) {
pr_debug pr_debug
("failed to read porttype, result=%d\n", ("failed to read porttype, result=%d\n",
@ -1169,9 +1167,7 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
/* Save the wepflags state */ /* Save the wepflags state */
result = hfa384x_drvr_getconfig16(hw, result = hfa384x_drvr_getconfig16(hw,
HFA384x_RID_CNFWEPFLAGS, HFA384x_RID_CNFWEPFLAGS,
& &(hw->presniff_wepflags));
(hw->
presniff_wepflags));
if (result) { if (result) {
pr_debug pr_debug
("failed to read wepflags, result=%d\n", ("failed to read wepflags, result=%d\n",

View file

@ -113,8 +113,7 @@ static int prism2mib_flag(mibrec_t *mib,
p80211msg_dot11req_mibset_t *msg, void *data); p80211msg_dot11req_mibset_t *msg, void *data);
static int prism2mib_wepdefaultkey(mibrec_t *mib, static int prism2mib_wepdefaultkey(mibrec_t *mib,
int isget, int isget, wlandevice_t *wlandev,
wlandevice_t * wlandev,
hfa384x_t *hw, hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg, p80211msg_dot11req_mibset_t *msg,
void *data); void *data);

View file

@ -64,7 +64,7 @@
#include <linux/byteorder/generic.h> #include <linux/byteorder/generic.h>
#include <linux/ctype.h> #include <linux/ctype.h>
#include <asm/io.h> #include <linux/io.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <linux/if_arp.h> #include <linux/if_arp.h>
@ -1281,8 +1281,7 @@ void prism2sta_processing_defer(struct work_struct *data)
goto failed; goto failed;
} }
prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *) &ssid, prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *) &ssid,
(p80211pstrd_t *) & (p80211pstrd_t *) &wlandev->ssid);
wlandev->ssid);
/* Collect the port status */ /* Collect the port status */
result = hfa384x_drvr_getconfig16(hw, result = hfa384x_drvr_getconfig16(hw,