diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-05 14:50:51 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-05 14:50:51 -0700 |
commit | 41844e36206be90cd4d962ea49b0abc3612a99d0 (patch) | |
tree | ce0b3a3403bc6abdb28f52779d0d7b57a51a5c86 /drivers/staging/ks7010/ks_hostif.c | |
parent | 5691f0e9a3e7855832d5fd094801bf600347c2d0 (diff) | |
parent | fc1e2c8ea85e109acf09e74789e9b852f6eed251 (diff) | |
download | op-kernel-dev-41844e36206be90cd4d962ea49b0abc3612a99d0.zip op-kernel-dev-41844e36206be90cd4d962ea49b0abc3612a99d0.tar.gz |
Merge tag 'staging-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging and IIO updates from Greg KH:
"Here is the big staging and IIO driver pull request for 4.9-rc1.
There are a lot of patches in here, the majority due to the
drivers/staging/greybus/ subsystem being merged in with full
development history that went back a few years, in order to preserve
the work that those developers did over time.
Lots and lots of tiny cleanups happened in the tree as well, due to
the Outreachy application process and lots of other developers showing
up for the first time to clean code up. Along with those changes, we
deleted a wireless driver, and added a raspberrypi driver (currently
marked broken), and lots of new iio drivers.
Overall the tree still shrunk with more lines removed than added,
about 10 thousand lines removed in total. Full details are in the very
long shortlog below.
All of this has been in the linux-next tree with no issues. There will
be some merge problems with other subsystem trees, but those are all
minor problems and shouldn't be hard to work out when they happen
(MAINTAINERS and some lustre build problems with the IB tree)"
And furter from me asking for clarification about greybus:
"Right now there is a phone from Motorola shipping with this code (a
slightly older version, but the same tree), so even though Ara is not
alive in the same form, the functionality is happening. We are working
with the developers of that phone to merge the newer stuff in with
their fork so they can use the upstream version in future versions of
their phone product line.
Toshiba has at least one chip shipping in their catalog that
needs/uses this protocol over a Unipro link, and rumor has it that
there might be more in the future.
There are also other users of the greybus protocols, there is a talk
next week at ELC that shows how it is being used across a network
connection to control a device, and previous ELC talks have showed the
protocol stack being used over USB to drive embedded Linux boards.
I've also talked to some people who are starting to work to add a host
controller driver to control arduinos as the greybus PHY protocols are
very useful to control a serial/i2c/spio/whatever device across a
random physical link, as it is a way to have a self-describing device
be attached to a host without needing manual configuration.
So yes, people are using it, and there is still the chance that it
will show up in a phone/laptop/tablet/whatever from Google in the
future as well, the tech isn't dead, even if the original large phone
project happens to be"
* tag 'staging-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (3703 commits)
Staging: fbtft: Fix bug in fbtft-core
staging: rtl8188eu: fix double unlock error in rtw_resume_process()
staging:r8188eu: remove GEN_MLME_EXT_HANDLER macro
staging:r8188eu: remove GEN_DRV_CMD_HANDLER macro
staging:r8188eu: remove GEN_EVT_CODE macro
staging:r8188eu: remove GEN_CMD_CODE macro
staging:r8188eu: remove pkt_newalloc member of the recv_buf structure
staging:r8188eu: remove rtw_handle_dualmac declaration
staging:r8188eu: remove (RGTRY|BSSID)_(OFT|SZ) macros
staging:r8188eu: change rtl8188e_process_phy_info function argument type
Staging: fsl-mc: Remove blank lines
Staging: fsl-mc: Fix unaligned * in block comments
Staging: comedi: Align the * in block comments
Staging : ks7010 : Fix block comments warninig
Staging: vt6655: Remove explicit NULL comparison using Coccinelle
staging: rtl8188eu: core: rtw_xmit: Use macros instead of constants
staging: rtl8188eu: core: rtw_xmit: Move constant of the right side
staging: dgnc: Fix lines longer than 80 characters
Staging: dgnc: constify attribute_group structures
Staging: most: hdm-dim2: constify attribute_group structures
...
Diffstat (limited to 'drivers/staging/ks7010/ks_hostif.c')
-rw-r--r-- | drivers/staging/ks7010/ks_hostif.c | 158 |
1 files changed, 69 insertions, 89 deletions
diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index a8822fe..c57ca58 100644 --- a/drivers/staging/ks7010/ks_hostif.c +++ b/drivers/staging/ks7010/ks_hostif.c @@ -14,21 +14,13 @@ #include "eap_packet.h" #include "michael_mic.h" +#include <linux/etherdevice.h> #include <linux/if_ether.h> #include <linux/if_arp.h> /* Include Wireless Extension definition and check version */ #include <net/iw_handler.h> /* New driver API */ -extern int ks_wlan_hw_tx(struct ks_wlan_private *priv, void *p, - unsigned long size, - void (*complete_handler) (void *arg1, void *arg2), - void *arg1, void *arg2); -extern void send_packet_complete(void *, void *); - -extern void ks_wlan_hw_wakeup_request(struct ks_wlan_private *priv); -extern int ks_wlan_hw_power_save(struct ks_wlan_private *priv); - /* macro */ #define inc_smeqhead(priv) \ ( priv->sme_i.qhead = (priv->sme_i.qhead + 1) % SME_EVENT_BUFF_SIZE ) @@ -43,6 +35,7 @@ static inline u8 get_BYTE(struct ks_wlan_private *priv) { u8 data; + data = *(priv->rxp)++; /* length check in advance ! */ --(priv->rx_size); @@ -53,6 +46,7 @@ static inline u16 get_WORD(struct ks_wlan_private *priv) { u16 data; + data = (get_BYTE(priv) & 0xff); data |= ((get_BYTE(priv) << 8) & 0xff00); return data; @@ -62,6 +56,7 @@ static inline u32 get_DWORD(struct ks_wlan_private *priv) { u32 data; + data = (get_BYTE(priv) & 0xff); data |= ((get_BYTE(priv) << 8) & 0x0000ff00); data |= ((get_BYTE(priv) << 16) & 0x00ff0000); @@ -69,16 +64,20 @@ inline u32 get_DWORD(struct ks_wlan_private *priv) return data; } -void ks_wlan_hw_wakeup_task(struct work_struct *work) +static void ks_wlan_hw_wakeup_task(struct work_struct *work) { struct ks_wlan_private *priv = container_of(work, struct ks_wlan_private, ks_wlan_wakeup_task); int ps_status = atomic_read(&priv->psstatus.status); + long time_left; if (ps_status == PS_SNOOZE) { ks_wlan_hw_wakeup_request(priv); - if (!wait_for_completion_interruptible_timeout(&priv->psstatus.wakeup_wait, HZ / 50)) { /* 20ms timeout */ - DPRINTK(1, "wake up timeout !!!\n"); + time_left = wait_for_completion_interruptible_timeout( + &priv->psstatus.wakeup_wait, + msecs_to_jiffies(20)); + if (time_left <= 0) { + DPRINTK(1, "wake up timeout or interrupted !!!\n"); schedule_work(&priv->ks_wlan_wakeup_task); return; } @@ -96,8 +95,6 @@ void ks_wlan_hw_wakeup_task(struct work_struct *work) static int ks_wlan_do_power_save(struct ks_wlan_private *priv) { - int rc = 0; - DPRINTK(4, "psstatus.status=%d\n", atomic_read(&priv->psstatus.status)); if ((priv->connect_status & CONNECT_STATUS_MASK) == CONNECT_STATUS) { @@ -105,7 +102,7 @@ int ks_wlan_do_power_save(struct ks_wlan_private *priv) } else { priv->dev_state = DEVICE_STATE_READY; } - return rc; + return 0; } static @@ -217,7 +214,6 @@ int get_ap_information(struct ks_wlan_private *priv, struct ap_info_t *ap_info, { unsigned char *bp; int bsize, offset; - int rc = 0; DPRINTK(3, "\n"); memset(ap, 0, sizeof(struct local_ap_t)); @@ -240,13 +236,13 @@ int get_ap_information(struct ks_wlan_private *priv, struct ap_info_t *ap_info, offset = 0; while (bsize > offset) { - /* DPRINTK(4, "Element ID=%d \n",*bp); */ + /* DPRINTK(4, "Element ID=%d\n",*bp); */ switch (*bp) { case 0: /* ssid */ if (*(bp + 1) <= SSID_MAX_SIZE) { ap->ssid.size = *(bp + 1); } else { - DPRINTK(1, "size over :: ssid size=%d \n", + DPRINTK(1, "size over :: ssid size=%d\n", *(bp + 1)); ap->ssid.size = SSID_MAX_SIZE; } @@ -260,7 +256,7 @@ int get_ap_information(struct ks_wlan_private *priv, struct ap_info_t *ap_info, bp + 2, *(bp + 1)); ap->rate_set.size += *(bp + 1); } else { - DPRINTK(1, "size over :: rate size=%d \n", + DPRINTK(1, "size over :: rate size=%d\n", (*(bp + 1) + ap->rate_set.size)); memcpy(&(ap->rate_set.body[ap->rate_set.size]), bp + 2, @@ -276,7 +272,7 @@ int get_ap_information(struct ks_wlan_private *priv, struct ap_info_t *ap_info, if (*(bp + 1) <= RSN_IE_BODY_MAX) { ap->rsn_ie.size = *(bp + 1); } else { - DPRINTK(1, "size over :: rsn size=%d \n", + DPRINTK(1, "size over :: rsn size=%d\n", *(bp + 1)); ap->rsn_ie.size = RSN_IE_BODY_MAX; } @@ -289,7 +285,7 @@ int get_ap_information(struct ks_wlan_private *priv, struct ap_info_t *ap_info, ap->wpa_ie.size = *(bp + 1); } else { DPRINTK(1, - "size over :: wpa size=%d \n", + "size over :: wpa size=%d\n", *(bp + 1)); ap->wpa_ie.size = RSN_IE_BODY_MAX; } @@ -307,7 +303,7 @@ int get_ap_information(struct ks_wlan_private *priv, struct ap_info_t *ap_info, case 47: /* Reserve ID 47 Broadcom AP */ break; default: - DPRINTK(4, "unknown Element ID=%d \n", *bp); + DPRINTK(4, "unknown Element ID=%d\n", *bp); break; } offset += 2; /* id & size field */ @@ -315,7 +311,7 @@ int get_ap_information(struct ks_wlan_private *priv, struct ap_info_t *ap_info, bp += (*(bp + 1) + 2); /* pointer update */ } - return rc; + return 0; } static @@ -404,7 +400,7 @@ void hostif_data_indication(struct ks_wlan_private *priv) HZ >= 60) { mic_failure->failure = 0; } - DPRINTK(4, "MIC FAILURE \n"); + DPRINTK(4, "MIC FAILURE\n"); if (mic_failure->failure == 0) { mic_failure->failure = 1; mic_failure->counter = 0; @@ -481,8 +477,7 @@ void hostif_data_indication(struct ks_wlan_private *priv) netif_rx(skb); } else { printk(KERN_WARNING - "%s: Memory squeeze, dropping packet.\n", - skb->dev->name); + "ks_wlan: Memory squeeze, dropping packet.\n"); priv->nstats.rx_dropped++; } break; @@ -517,8 +512,7 @@ void hostif_data_indication(struct ks_wlan_private *priv) netif_rx(skb); } else { printk(KERN_WARNING - "%s: Memory squeeze, dropping packet.\n", - skb->dev->name); + "ks_wlan: Memory squeeze, dropping packet.\n"); priv->nstats.rx_dropped++; } break; @@ -778,7 +772,7 @@ void hostif_start_confirm(struct ks_wlan_private *priv) wrqu.data.flags = 0; wrqu.ap_addr.sa_family = ARPHRD_ETHER; if ((priv->connect_status & CONNECT_STATUS_MASK) == CONNECT_STATUS) { - memset(wrqu.ap_addr.sa_data, '\0', ETH_ALEN); + eth_zero_addr(wrqu.ap_addr.sa_data); DPRINTK(3, "IWEVENT: disconnect\n"); wireless_send_event(priv->net_dev, SIOCGIWAP, &wrqu, NULL); } @@ -836,7 +830,7 @@ void hostif_connect_indication(struct ks_wlan_private *priv) wrqu0.ap_addr.sa_family = ARPHRD_ETHER; if ((priv->connect_status & CONNECT_STATUS_MASK) == DISCONNECT_STATUS && (old_status & CONNECT_STATUS_MASK) == CONNECT_STATUS) { - memset(wrqu0.ap_addr.sa_data, '\0', ETH_ALEN); + eth_zero_addr(wrqu0.ap_addr.sa_data); DPRINTK(3, "IWEVENT: disconnect\n"); DPRINTK(3, "disconnect :: scan_ind_count=%d\n", priv->scan_ind_count); @@ -908,7 +902,7 @@ void hostif_stop_confirm(struct ks_wlan_private *priv) if ((priv->connect_status & CONNECT_STATUS_MASK) == DISCONNECT_STATUS && (old_status & CONNECT_STATUS_MASK) == CONNECT_STATUS) { - memset(wrqu0.ap_addr.sa_data, '\0', ETH_ALEN); + eth_zero_addr(wrqu0.ap_addr.sa_data); DPRINTK(3, "IWEVENT: disconnect\n"); printk("IWEVENT: disconnect\n"); DPRINTK(3, "disconnect :: scan_ind_count=%d\n", @@ -1148,7 +1142,7 @@ int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *packet) packet_len = packet->len; if (packet_len > ETH_FRAME_LEN) { - DPRINTK(1, "bad length packet_len=%d \n", packet_len); + DPRINTK(1, "bad length packet_len=%d\n", packet_len); dev_kfree_skb(packet); return -1; } @@ -1172,11 +1166,10 @@ int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *packet) } DPRINTK(4, "skb_buff length=%d\n", packet_len); - pp = (struct hostif_data_request_t *) - kmalloc(hif_align_size(sizeof(*pp) + 6 + packet_len + 8), - KS_WLAN_MEM_FLAG); + pp = kmalloc(hif_align_size(sizeof(*pp) + 6 + packet_len + 8), + KS_WLAN_MEM_FLAG); - if (pp == NULL) { + if (!pp) { DPRINTK(3, "allocate memory failed..\n"); dev_kfree_skb(packet); return -2; @@ -1194,6 +1187,8 @@ int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *packet) DPRINTK(1, "ethernet->h_source=%02X:%02X:%02X:%02X:%02X:%02X\n", eth->h_source[0], eth->h_source[1], eth->h_source[2], eth->h_source[3], eth->h_source[4], eth->h_source[5]); + dev_kfree_skb(packet); + kfree(pp); return -3; } @@ -1231,7 +1226,7 @@ int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *packet) eth_hdr = (struct ether_hdr *)&pp->data[0]; eth_proto = ntohs(eth_hdr->h_proto); - /* for MIC FAILUER REPORT check */ + /* for MIC FAILURE REPORT check */ if (eth_proto == ETHER_PROTOCOL_TYPE_EAP && priv->wpa.mic_failure.failure > 0) { aa1x_hdr = (struct ieee802_1x_hdr *)(eth_hdr + 1); @@ -1284,7 +1279,7 @@ int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *packet) (void *)send_packet_complete, (void *)priv, (void *)packet); - /* MIC FAILUER REPORT check */ + /* MIC FAILURE REPORT check */ if (eth_proto == ETHER_PROTOCOL_TYPE_EAP && priv->wpa.mic_failure.failure > 0) { if (keyinfo & WPA_KEY_INFO_ERROR @@ -1313,9 +1308,8 @@ void hostif_mib_get_request(struct ks_wlan_private *priv, DPRINTK(3, "\n"); /* make primitive */ - pp = (struct hostif_mib_get_request_t *) - kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG); - if (pp == NULL) { + pp = kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG); + if (!pp) { DPRINTK(3, "allocate memory failed..\n"); return; } @@ -1344,9 +1338,8 @@ void hostif_mib_set_request(struct ks_wlan_private *priv, } /* make primitive */ - pp = (struct hostif_mib_set_request_t *) - kmalloc(hif_align_size(sizeof(*pp) + size), KS_WLAN_MEM_FLAG); - if (pp == NULL) { + pp = kmalloc(hif_align_size(sizeof(*pp) + size), KS_WLAN_MEM_FLAG); + if (!pp) { DPRINTK(3, "allocate memory failed..\n"); return; } @@ -1374,9 +1367,8 @@ void hostif_start_request(struct ks_wlan_private *priv, unsigned char mode) DPRINTK(3, "\n"); /* make primitive */ - pp = (struct hostif_start_request_t *) - kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG); - if (pp == NULL) { + pp = kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG); + if (!pp) { DPRINTK(3, "allocate memory failed..\n"); return; } @@ -1402,9 +1394,8 @@ void hostif_ps_adhoc_set_request(struct ks_wlan_private *priv) DPRINTK(3, "\n"); /* make primitive */ - pp = (struct hostif_ps_adhoc_set_request_t *) - kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG); - if (pp == NULL) { + pp = kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG); + if (!pp) { DPRINTK(3, "allocate memory failed..\n"); return; } @@ -1443,12 +1434,11 @@ void hostif_infrastructure_set_request(struct ks_wlan_private *priv) struct hostif_infrastructure_set_request_t *pp; uint16_t capability; - DPRINTK(3, "ssid.size=%d \n", priv->reg.ssid.size); + DPRINTK(3, "ssid.size=%d\n", priv->reg.ssid.size); /* make primitive */ - pp = (struct hostif_infrastructure_set_request_t *) - kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG); - if (pp == NULL) { + pp = kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG); + if (!pp) { DPRINTK(3, "allocate memory failed..\n"); return; } @@ -1505,17 +1495,16 @@ void hostif_infrastructure_set_request(struct ks_wlan_private *priv) ks_wlan_hw_tx(priv, pp, hif_align_size(sizeof(*pp)), NULL, NULL, NULL); } -void hostif_infrastructure_set2_request(struct ks_wlan_private *priv) +static void hostif_infrastructure_set2_request(struct ks_wlan_private *priv) { struct hostif_infrastructure_set2_request_t *pp; uint16_t capability; - DPRINTK(2, "ssid.size=%d \n", priv->reg.ssid.size); + DPRINTK(2, "ssid.size=%d\n", priv->reg.ssid.size); /* make primitive */ - pp = (struct hostif_infrastructure_set2_request_t *) - kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG); - if (pp == NULL) { + pp = kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG); + if (!pp) { DPRINTK(3, "allocate memory failed..\n"); return; } @@ -1583,9 +1572,8 @@ void hostif_adhoc_set_request(struct ks_wlan_private *priv) DPRINTK(3, "\n"); /* make primitive */ - pp = (struct hostif_adhoc_set_request_t *) - kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG); - if (pp == NULL) { + pp = kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG); + if (!pp) { DPRINTK(3, "allocate memory failed..\n"); return; } @@ -1629,9 +1617,8 @@ void hostif_adhoc_set2_request(struct ks_wlan_private *priv) DPRINTK(3, "\n"); /* make primitive */ - pp = (struct hostif_adhoc_set2_request_t *) - kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG); - if (pp == NULL) { + pp = kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG); + if (!pp) { DPRINTK(3, "allocate memory failed..\n"); return; } @@ -1677,9 +1664,8 @@ void hostif_stop_request(struct ks_wlan_private *priv) DPRINTK(3, "\n"); /* make primitive */ - pp = (struct hostif_stop_request_t *) - kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG); - if (pp == NULL) { + pp = kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG); + if (!pp) { DPRINTK(3, "allocate memory failed..\n"); return; } @@ -1700,9 +1686,8 @@ void hostif_phy_information_request(struct ks_wlan_private *priv) DPRINTK(3, "\n"); /* make primitive */ - pp = (struct hostif_phy_information_request_t *) - kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG); - if (pp == NULL) { + pp = kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG); + if (!pp) { DPRINTK(3, "allocate memory failed..\n"); return; } @@ -1732,9 +1717,8 @@ void hostif_power_mngmt_request(struct ks_wlan_private *priv, DPRINTK(3, "mode=%lu wake_up=%lu receiveDTIMs=%lu\n", mode, wake_up, receiveDTIMs); /* make primitive */ - pp = (struct hostif_power_mngmt_request_t *) - kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG); - if (pp == NULL) { + pp = kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG); + if (!pp) { DPRINTK(3, "allocate memory failed..\n"); return; } @@ -1755,13 +1739,12 @@ void hostif_sleep_request(struct ks_wlan_private *priv, unsigned long mode) { struct hostif_sleep_request_t *pp; - DPRINTK(3, "mode=%lu \n", mode); + DPRINTK(3, "mode=%lu\n", mode); if (mode == SLP_SLEEP) { /* make primitive */ - pp = (struct hostif_sleep_request_t *) - kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG); - if (pp == NULL) { + pp = kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG); + if (!pp) { DPRINTK(3, "allocate memory failed..\n"); return; } @@ -1779,23 +1762,22 @@ void hostif_sleep_request(struct ks_wlan_private *priv, unsigned long mode) queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq, &priv->ks_wlan_hw.rw_wq, 1); } else { - DPRINTK(3, "invalid mode %ld \n", mode); + DPRINTK(3, "invalid mode %ld\n", mode); return; } } static void hostif_bss_scan_request(struct ks_wlan_private *priv, - unsigned long scan_type, uint8_t * scan_ssid, + unsigned long scan_type, uint8_t *scan_ssid, uint8_t scan_ssid_len) { struct hostif_bss_scan_request_t *pp; DPRINTK(2, "\n"); /* make primitive */ - pp = (struct hostif_bss_scan_request_t *) - kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG); - if (pp == NULL) { + pp = kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG); + if (!pp) { DPRINTK(3, "allocate memory failed..\n"); return; } @@ -1850,9 +1832,8 @@ void hostif_mic_failure_request(struct ks_wlan_private *priv, DPRINTK(3, "count=%d :: timer=%d\n", failure_count, timer); /* make primitive */ - pp = (struct hostif_mic_failure_request_t *) - kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG); - if (pp == NULL) { + pp = kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG); + if (!pp) { DPRINTK(3, "allocate memory failed..\n"); return; } @@ -1867,7 +1848,7 @@ void hostif_mic_failure_request(struct ks_wlan_private *priv, ks_wlan_hw_tx(priv, pp, hif_align_size(sizeof(*pp)), NULL, NULL, NULL); } -/* Device I/O Recieve indicate */ +/* Device I/O Receive indicate */ static void devio_rec_ind(struct ks_wlan_private *priv, unsigned char *p, unsigned int size) { @@ -2700,7 +2681,6 @@ void hostif_sme_enqueue(struct ks_wlan_private *priv, unsigned short event) int hostif_init(struct ks_wlan_private *priv) { - int rc = 0; int i; DPRINTK(3, "\n"); @@ -2750,7 +2730,7 @@ int hostif_init(struct ks_wlan_private *priv) tasklet_init(&priv->sme_task, hostif_sme_task, (unsigned long)priv); - return rc; + return 0; } void hostif_exit(struct ks_wlan_private *priv) |