Commit 10e13123 authored by Michael Straube's avatar Michael Straube Committed by Greg Kroah-Hartman

staging: r8188eu: clean up spacing style issues in os_dep dir

Clean up spacing style issues reported by checkpatch in the os_dep
directory.

CHECK: spaces preferred around that ...
CHECK: No space is necessary after a cast
WARNING: space prohibited before semicolon
WARNING: space prohibited between function name and open parenthesis '('
ERROR: spaces required around that '=' (ctx:VxV)
Signed-off-by: default avatarMichael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210816211053.31728-1-straube.linux@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 47a0bab3
......@@ -119,13 +119,13 @@ void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie)
return;
p = buff;
p += sprintf(p, "ASSOCINFO(ReqIEs =");
len = sec_ie[1]+2;
len = sec_ie[1] + 2;
len = (len < IW_CUSTOM_MAX) ? len : IW_CUSTOM_MAX;
for (i = 0; i < len; i++)
p += sprintf(p, "%02x", sec_ie[i]);
p += sprintf(p, ")");
memset(&wrqu, 0, sizeof(wrqu));
wrqu.data.length = p-buff;
wrqu.data.length = p - buff;
wrqu.data.length = (wrqu.data.length < IW_CUSTOM_MAX) ?
wrqu.data.length : IW_CUSTOM_MAX;
wireless_send_event(adapter->pnetdev, IWEVCUSTOM, &wrqu, buff);
......
......@@ -516,7 +516,7 @@ static uint loadparam(struct adapter *padapter, struct net_device *pnetdev)
registry_par->channel = (u8)rtw_channel;
registry_par->wireless_mode = (u8)rtw_wireless_mode;
registry_par->vrtl_carrier_sense = (u8)rtw_vrtl_carrier_sense ;
registry_par->vrtl_carrier_sense = (u8)rtw_vrtl_carrier_sense;
registry_par->vcs_type = (u8)rtw_vcs_type;
registry_par->rts_thresh = (u16)rtw_rts_thresh;
registry_par->frag_thresh = (u16)rtw_frag_thresh;
......@@ -658,11 +658,11 @@ u16 rtw_recv_select_queue(struct sk_buff *skb)
u32 priority;
u8 *pdata = skb->data;
memcpy(&eth_type, pdata+(ETH_ALEN<<1), 2);
memcpy(&eth_type, pdata + (ETH_ALEN << 1), 2);
switch (eth_type) {
case htons(ETH_P_IP):
piphdr = (struct iphdr *)(pdata+ETH_HLEN);
piphdr = (struct iphdr *)(pdata + ETH_HLEN);
dscp = piphdr->tos & 0xfc;
priority = dscp >> 5;
break;
......@@ -716,7 +716,7 @@ struct net_device *rtw_init_netdev(struct adapter *old_padapter)
padapter->pnetdev = pnetdev;
DBG_88E("register rtw_netdev_ops to netdev_ops\n");
pnetdev->netdev_ops = &rtw_netdev_ops;
pnetdev->watchdog_timeo = HZ*3; /* 3 second timeout */
pnetdev->watchdog_timeo = HZ * 3; /* 3 second timeout */
pnetdev->wireless_handlers = (struct iw_handler_def *)&rtw_handlers_def;
/* step 2. */
......
......@@ -61,7 +61,7 @@ void *rtw_malloc2d(int h, int w, int size)
return NULL;
for (j = 0; j < h; j++)
a[j] = ((char *)(a+h)) + j*w*size;
a[j] = ((char *)(a + h)) + j * w * size;
return a;
}
......@@ -112,15 +112,15 @@ inline u32 rtw_ms_to_systime(u32 ms)
/* the input parameter start use the same unit as jiffies */
inline s32 rtw_get_passing_time_ms(u32 start)
{
return rtw_systime_to_ms(jiffies-start);
return rtw_systime_to_ms(jiffies - start);
}
void rtw_usleep_os(int us)
{
if (1 < (us/1000))
if (1 < (us / 1000))
msleep(1);
else
msleep((us/1000) + 1);
msleep((us / 1000) + 1);
}
#define RTW_SUSPEND_LOCK_NAME "rtw_wifi"
......@@ -282,7 +282,7 @@ void rtw_buf_update(u8 **buf, u32 *buf_len, u8 *src, u32 src_len)
*/
inline bool rtw_cbuf_full(struct rtw_cbuf *cbuf)
{
return (cbuf->write == cbuf->read-1) ? true : false;
return (cbuf->write == cbuf->read - 1) ? true : false;
}
/**
......@@ -312,7 +312,7 @@ bool rtw_cbuf_push(struct rtw_cbuf *cbuf, void *buf)
if (0)
DBG_88E("%s on %u\n", __func__, cbuf->write);
cbuf->bufs[cbuf->write] = buf;
cbuf->write = (cbuf->write+1)%cbuf->size;
cbuf->write = (cbuf->write + 1) % cbuf->size;
return _SUCCESS;
}
......@@ -333,7 +333,7 @@ void *rtw_cbuf_pop(struct rtw_cbuf *cbuf)
if (0)
DBG_88E("%s on %u\n", __func__, cbuf->read);
buf = cbuf->bufs[cbuf->read];
cbuf->read = (cbuf->read+1)%cbuf->size;
cbuf->read = (cbuf->read + 1) % cbuf->size;
return buf;
}
......@@ -348,7 +348,7 @@ struct rtw_cbuf *rtw_cbuf_alloc(u32 size)
{
struct rtw_cbuf *cbuf;
cbuf = kmalloc(sizeof(*cbuf) + sizeof(void *)*size, GFP_KERNEL);
cbuf = kmalloc(sizeof(*cbuf) + sizeof(void *) * size, GFP_KERNEL);
if (cbuf) {
cbuf->write = 0;
......
......@@ -78,7 +78,7 @@ void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup)
} else {
cur_time = jiffies;
if (cur_time - psecuritypriv->last_mic_err_time < 60*HZ) {
if (cur_time - psecuritypriv->last_mic_err_time < 60 * HZ) {
psecuritypriv->btkip_countermeasure = true;
psecuritypriv->last_mic_err_time = 0;
psecuritypriv->btkip_countermeasure_time = cur_time;
......
......@@ -62,7 +62,7 @@ static int g_wifi_on = true;
int rtw_android_cmdstr_to_num(char *cmdstr)
{
int cmd_num;
for (cmd_num=0; cmd_num < ANDROID_WIFI_CMD_MAX; cmd_num++)
for (cmd_num = 0; cmd_num < ANDROID_WIFI_CMD_MAX; cmd_num++)
if (!strncasecmp(cmdstr, android_wifi_cmd_str[cmd_num],
strlen(android_wifi_cmd_str[cmd_num])))
break;
......
......@@ -312,7 +312,7 @@ static void process_spec_devid(const struct usb_device_id *pdid)
flags = specific_device_id_tbl[i].flags;
if ((pdid->idVendor == vid) && (pdid->idProduct == pid) &&
(flags&SPEC_DEV_ID_DISABLE_HT)) {
(flags & SPEC_DEV_ID_DISABLE_HT)) {
rtw_ht_enable = 0;
rtw_cbw40_enable = 0;
rtw_ampdu_enable = 0;
......
......@@ -41,7 +41,7 @@ void _rtw_open_pktfile(struct sk_buff *pktptr, struct pkt_file *pfile)
}
uint _rtw_pktfile_read (struct pkt_file *pfile, u8 *rmem, uint rlen)
uint _rtw_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen)
{
uint len = 0;
......@@ -49,7 +49,7 @@ uint _rtw_pktfile_read (struct pkt_file *pfile, u8 *rmem, uint rlen)
len = (rlen > len) ? len : rlen;
if (rmem)
skb_copy_bits(pfile->pkt, pfile->buf_len-pfile->pkt_len, rmem, len);
skb_copy_bits(pfile->pkt, pfile->buf_len - pfile->pkt_len, rmem, len);
pfile->cur_addr += len;
pfile->pkt_len -= len;
......@@ -104,7 +104,7 @@ void rtw_os_xmit_resource_free(struct adapter *padapter,
kfree(pxmitbuf->pallocated_buf);
}
#define WMM_XMIT_THRESHOLD (NR_XMITFRAME*2/5)
#define WMM_XMIT_THRESHOLD (NR_XMITFRAME * 2 / 5)
void rtw_os_pkt_complete(struct adapter *padapter, struct sk_buff *pkt)
{
......@@ -230,7 +230,7 @@ int rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev)
if (!rtw_mc2u_disable && check_fwstate(pmlmepriv, WIFI_AP_STATE) &&
(IP_MCAST_MAC(pkt->data) || ICMPV6_MCAST_MAC(pkt->data)) &&
(padapter->registrypriv.wifi_spec == 0)) {
if (pxmitpriv->free_xmitframe_cnt > (NR_XMITFRAME/4)) {
if (pxmitpriv->free_xmitframe_cnt > (NR_XMITFRAME / 4)) {
res = rtw_mlcst2unicst(padapter, pkt);
if (res)
goto exit;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment