staging: gdm72xx: Whitespace fixes to conform to coding standards

Fixes the following checkpatch.pl issues:

WARNING: unnecessary whitespace before a quoted newline
CHECK: Alignment should match open parenthesis
CHECK: No space is necessary after a cast

Also some additional, whitespace related, readability issues.

Signed-off-by: Michalis Pappas <mpappas@fastmail.fm>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Michalis Pappas 2014-05-09 18:08:27 +08:00 committed by Greg Kroah-Hartman
parent b268666f6b
commit 39c511f8cb
8 changed files with 99 additions and 121 deletions

View File

@ -47,8 +47,7 @@ static void *alloc_qos_entry(void)
spin_lock_irqsave(&qos_free_list.lock, flags); spin_lock_irqsave(&qos_free_list.lock, flags);
if (qos_free_list.cnt) { if (qos_free_list.cnt) {
entry = list_entry(qos_free_list.head.prev, struct qos_entry_s, entry = list_entry(qos_free_list.head.prev, struct qos_entry_s, list);
list);
list_del(&entry->list); list_del(&entry->list);
qos_free_list.cnt--; qos_free_list.cnt--;
spin_unlock_irqrestore(&qos_free_list.lock, flags); spin_unlock_irqrestore(&qos_free_list.lock, flags);
@ -198,17 +197,17 @@ static u32 get_qos_index(struct nic *nic, u8 *iph, u8 *tcpudph)
IP_ver = (iph[0]>>4)&0xf; IP_ver = (iph[0]>>4)&0xf;
if (IP_ver == 4) { if (IP_ver != 4)
return -1;
for (i = 0; i < QOS_MAX; i++) { for (i = 0; i < QOS_MAX; i++) {
if (qcb->csr[i].enabled) { if (!qcb->csr[i].enabled)
if (qcb->csr[i].classifier_rule_en) { continue;
if (chk_ipv4_rule(&qcb->csr[i], iph, if (!qcb->csr[i].classifier_rule_en)
tcpudph) == 0) continue;
if (chk_ipv4_rule(&qcb->csr[i], iph, tcpudph) == 0)
return i; return i;
} }
}
}
}
return -1; return -1;
} }
@ -222,22 +221,20 @@ static u32 extract_qos_list(struct nic *nic, struct list_head *head)
INIT_LIST_HEAD(head); INIT_LIST_HEAD(head);
for (i = 0; i < QOS_MAX; i++) { for (i = 0; i < QOS_MAX; i++) {
if (qcb->csr[i].enabled) { if (!qcb->csr[i].enabled)
if (qcb->csr[i].qos_buf_count < qcb->qos_limit_size) { continue;
if (!list_empty(&qcb->qos_list[i])) { if (qcb->csr[i].qos_buf_count >= qcb->qos_limit_size)
entry = list_entry( continue;
qcb->qos_list[i].prev, if (list_empty(&qcb->qos_list[i]))
struct qos_entry_s, list); continue;
entry = list_entry(qcb->qos_list[i].prev, struct qos_entry_s, list);
list_move_tail(&entry->list, head); list_move_tail(&entry->list, head);
qcb->csr[i].qos_buf_count++; qcb->csr[i].qos_buf_count++;
if (!list_empty(&qcb->qos_list[i])) if (!list_empty(&qcb->qos_list[i]))
netdev_warn(nic->netdev, netdev_warn(nic->netdev, "Index(%d) is piled!!\n", i);
"Index(%d) is piled!!\n",
i);
}
}
}
} }
return 0; return 0;
@ -433,8 +430,7 @@ void gdm_recv_qos_hci_packet(void *nic_ptr, u8 *buf, int size)
qcb->qos_list_cnt--; qcb->qos_list_cnt--;
qcb->qos_limit_size = 254/qcb->qos_list_cnt; qcb->qos_limit_size = 254/qcb->qos_list_cnt;
list_for_each_entry_safe(entry, n, &qcb->qos_list[index], list_for_each_entry_safe(entry, n, &qcb->qos_list[index], list) {
list) {
list_move_tail(&entry->list, &free_list); list_move_tail(&entry->list, &free_list);
} }
spin_unlock_irqrestore(&qcb->qos_lock, flags); spin_unlock_irqrestore(&qcb->qos_lock, flags);

View File

@ -312,8 +312,7 @@ static void send_sdu(struct sdio_func *func, struct tx_cxt *tx)
spin_unlock_irqrestore(&tx->lock, flags); spin_unlock_irqrestore(&tx->lock, flags);
} }
static void send_hci(struct sdio_func *func, struct tx_cxt *tx, static void send_hci(struct sdio_func *func, struct tx_cxt *tx, struct sdio_tx *t)
struct sdio_tx *t)
{ {
unsigned long flags; unsigned long flags;
@ -510,6 +509,7 @@ static void gdm_sdio_irq(struct sdio_func *func)
if (hdr[3] == 1) { /* Ack */ if (hdr[3] == 1) { /* Ack */
u32 *ack_seq = (u32 *)&hdr[4]; u32 *ack_seq = (u32 *)&hdr[4];
spin_lock_irqsave(&tx->lock, flags); spin_lock_irqsave(&tx->lock, flags);
tx->can_send = 1; tx->can_send = 1;
@ -601,8 +601,7 @@ static int gdm_sdio_receive(void *priv_dev,
return 0; return 0;
} }
static int sdio_wimax_probe(struct sdio_func *func, static int sdio_wimax_probe(struct sdio_func *func, const struct sdio_device_id *id)
const struct sdio_device_id *id)
{ {
int ret; int ret;
struct phy_dev *phy_dev = NULL; struct phy_dev *phy_dev = NULL;

View File

@ -344,16 +344,11 @@ static int gdm_usb_send(void *priv_dev, void *data, int len,
if ((len % 512) == 0) if ((len % 512) == 0)
len++; len++;
usb_fill_bulk_urb(t->urb, usb_fill_bulk_urb(t->urb, usbdev, usb_sndbulkpipe(usbdev, 1), t->buf,
usbdev, len + padding, gdm_usb_send_complete, t);
usb_sndbulkpipe(usbdev, 1),
t->buf,
len + padding,
gdm_usb_send_complete,
t);
print_hex_dump_debug("usb_send: ", DUMP_PREFIX_NONE, 16, 1, print_hex_dump_debug("usb_send: ", DUMP_PREFIX_NONE, 16, 1, t->buf,
t->buf, len + padding, false); len + padding, false);
#ifdef CONFIG_WIMAX_GDM72XX_USB_PM #ifdef CONFIG_WIMAX_GDM72XX_USB_PM
if (usbdev->state & USB_STATE_SUSPENDED) { if (usbdev->state & USB_STATE_SUSPENDED) {
list_add_tail(&t->p_list, &tx->pending_list); list_add_tail(&t->p_list, &tx->pending_list);
@ -494,13 +489,8 @@ static int gdm_usb_receive(void *priv_dev,
r->callback = cb; r->callback = cb;
r->cb_data = cb_data; r->cb_data = cb_data;
usb_fill_bulk_urb(r->urb, usb_fill_bulk_urb(r->urb, usbdev, usb_rcvbulkpipe(usbdev, 0x82), r->buf,
usbdev, RX_BUF_SIZE, gdm_usb_rcv_complete, r);
usb_rcvbulkpipe(usbdev, 0x82),
r->buf,
RX_BUF_SIZE,
gdm_usb_rcv_complete,
r);
return usb_submit_urb(r->urb, GFP_ATOMIC); return usb_submit_urb(r->urb, GFP_ATOMIC);
} }
@ -536,8 +526,7 @@ static void do_pm_control(struct work_struct *work)
} }
#endif /* CONFIG_WIMAX_GDM72XX_USB_PM */ #endif /* CONFIG_WIMAX_GDM72XX_USB_PM */
static int gdm_usb_probe(struct usb_interface *intf, static int gdm_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
const struct usb_device_id *id)
{ {
int ret = 0; int ret = 0;
u8 bConfigurationValue; u8 bConfigurationValue;
@ -566,8 +555,7 @@ static int gdm_usb_probe(struct usb_interface *intf,
} }
/* Support for EEPROM bootloader */ /* Support for EEPROM bootloader */
if (bConfigurationValue == DOWNLOAD_CONF_VALUE || if (bConfigurationValue == DOWNLOAD_CONF_VALUE || idProduct & B_DOWNLOAD) {
idProduct & B_DOWNLOAD) {
ret = usb_boot(usbdev, bcdDevice); ret = usb_boot(usbdev, bcdDevice);
goto out; goto out;
} }
@ -639,8 +627,8 @@ static void gdm_usb_disconnect(struct usb_interface *intf)
idProduct = L2H(usbdev->descriptor.idProduct); idProduct = L2H(usbdev->descriptor.idProduct);
if (idProduct != EMERGENCY_PID && if (idProduct != EMERGENCY_PID &&
bConfigurationValue != DOWNLOAD_CONF_VALUE && bConfigurationValue != DOWNLOAD_CONF_VALUE && (idProduct & B_DOWNLOAD) == 0) {
(idProduct & B_DOWNLOAD) == 0) {
udev = phy_dev->priv_dev; udev = phy_dev->priv_dev;
udev->usbdev = NULL; udev->usbdev = NULL;
@ -742,8 +730,7 @@ static int k_mode_thread(void *arg)
spin_lock_irqsave(&tx->lock, flags); spin_lock_irqsave(&tx->lock, flags);
list_for_each_entry_safe(t, temp, &tx->pending_list, list_for_each_entry_safe(t, temp, &tx->pending_list, p_list) {
p_list) {
list_del(&t->p_list); list_del(&t->p_list);
ret = usb_submit_urb(t->urb, GFP_ATOMIC); ret = usb_submit_urb(t->urb, GFP_ATOMIC);

View File

@ -143,13 +143,13 @@ static void dump_eth_packet(struct net_device *dev, const char *title,
port = ntohs(uh->dest); port = ntohs(uh->dest);
} else if (protocol == ETH_P_IPV6) { } else if (protocol == ETH_P_IPV6) {
struct ipv6hdr *i6h = (struct ipv6hdr *)data; struct ipv6hdr *i6h = (struct ipv6hdr *)data;
uh = (struct udphdr *)((char *)i6h + sizeof(struct ipv6hdr)); uh = (struct udphdr *)((char *)i6h + sizeof(struct ipv6hdr));
ip_protocol = i6h->nexthdr; ip_protocol = i6h->nexthdr;
port = ntohs(uh->dest); port = ntohs(uh->dest);
} }
netdev_dbg(dev, "[%s] len=%d, %s, %s, %s\n", netdev_dbg(dev, "[%s] len=%d, %s, %s, %s\n", title, len,
title, len,
get_protocol_name(protocol), get_protocol_name(protocol),
get_ip_protocol_name(ip_protocol), get_ip_protocol_name(ip_protocol),
get_port_name(port)); get_port_name(port));
@ -199,6 +199,7 @@ static void gdm_wimax_event_rcv(struct net_device *dev, u16 type, void *msg,
u8 *buf = (u8 *)msg; u8 *buf = (u8 *)msg;
u16 hci_cmd = (buf[0]<<8) | buf[1]; u16 hci_cmd = (buf[0]<<8) | buf[1];
u16 hci_len = (buf[2]<<8) | buf[3]; u16 hci_len = (buf[2]<<8) | buf[3];
netdev_dbg(dev, "H=>D: 0x%04x(%d)\n", hci_cmd, hci_len); netdev_dbg(dev, "H=>D: 0x%04x(%d)\n", hci_cmd, hci_len);
gdm_wimax_send(nic, msg, len); gdm_wimax_send(nic, msg, len);
@ -310,6 +311,7 @@ static int gdm_wimax_event_send(struct net_device *dev, char *buf, int size)
u16 hci_cmd = ((u8)buf[0]<<8) | (u8)buf[1]; u16 hci_cmd = ((u8)buf[0]<<8) | (u8)buf[1];
u16 hci_len = ((u8)buf[2]<<8) | (u8)buf[3]; u16 hci_len = ((u8)buf[2]<<8) | (u8)buf[3];
netdev_dbg(dev, "D=>H: 0x%04x(%d)\n", hci_cmd, hci_len); netdev_dbg(dev, "D=>H: 0x%04x(%d)\n", hci_cmd, hci_len);
spin_lock_irqsave(&wm_event.evt_lock, flags); spin_lock_irqsave(&wm_event.evt_lock, flags);
@ -346,8 +348,7 @@ int gdm_wimax_send_tx(struct sk_buff *skb, struct net_device *dev)
int ret = 0; int ret = 0;
struct nic *nic = netdev_priv(dev); struct nic *nic = netdev_priv(dev);
ret = gdm_wimax_send_with_cb(nic, skb->data, skb->len, tx_complete, ret = gdm_wimax_send_with_cb(nic, skb->data, skb->len, tx_complete, nic);
nic);
if (ret == -ENOSPC) { if (ret == -ENOSPC) {
netif_stop_queue(dev); netif_stop_queue(dev);
ret = 0; ret = 0;
@ -536,8 +537,7 @@ static void gdm_wimax_cleanup_ioctl(struct net_device *dev)
static void gdm_update_fsm(struct net_device *dev, struct fsm_s *new_fsm) static void gdm_update_fsm(struct net_device *dev, struct fsm_s *new_fsm)
{ {
struct nic *nic = netdev_priv(dev); struct nic *nic = netdev_priv(dev);
struct fsm_s *cur_fsm = struct fsm_s *cur_fsm = (struct fsm_s *)nic->sdk_data[SIOC_DATA_FSM].buf;
(struct fsm_s *) nic->sdk_data[SIOC_DATA_FSM].buf;
if (!cur_fsm) if (!cur_fsm)
return; return;
@ -582,8 +582,7 @@ static int gdm_wimax_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
if (req->data_id == SIOC_DATA_FSM) { if (req->data_id == SIOC_DATA_FSM) {
/*NOTE: gdm_update_fsm should be called /*NOTE: gdm_update_fsm should be called
before gdm_wimax_ioctl_set_data is called*/ before gdm_wimax_ioctl_set_data is called*/
gdm_update_fsm(dev, gdm_update_fsm(dev, (struct fsm_s *)req->data.buf);
(struct fsm_s *) req->data.buf);
} }
ret = gdm_wimax_ioctl_set_data( ret = gdm_wimax_ioctl_set_data(
&nic->sdk_data[req->data_id], &req->data); &nic->sdk_data[req->data_id], &req->data);
@ -660,8 +659,7 @@ static int gdm_wimax_hci_get_tlv(u8 *buf, u8 *T, u16 *L, u8 **V)
return next_pos; return next_pos;
} }
static int gdm_wimax_get_prepared_info(struct net_device *dev, char *buf, static int gdm_wimax_get_prepared_info(struct net_device *dev, char *buf, int len)
int len)
{ {
u8 T, *V; u8 T, *V;
u16 L; u16 L;
@ -785,8 +783,7 @@ static void gdm_wimax_transmit_pkt(struct net_device *dev, char *buf, int len)
switch (cmd_evt) { switch (cmd_evt) {
case WIMAX_RX_SDU_AGGR: case WIMAX_RX_SDU_AGGR:
gdm_wimax_transmit_aggr_pkt(dev, &buf[HCI_HEADER_SIZE], gdm_wimax_transmit_aggr_pkt(dev, &buf[HCI_HEADER_SIZE], cmd_len);
cmd_len);
break; break;
case WIMAX_RX_SDU: case WIMAX_RX_SDU:
gdm_wimax_netif_rx(dev, &buf[HCI_HEADER_SIZE], cmd_len); gdm_wimax_netif_rx(dev, &buf[HCI_HEADER_SIZE], cmd_len);

View File

@ -55,8 +55,7 @@ static void netlink_rcv_cb(struct sk_buff *skb)
if (skb->len >= NLMSG_HDRLEN) { if (skb->len >= NLMSG_HDRLEN) {
nlh = (struct nlmsghdr *)skb->data; nlh = (struct nlmsghdr *)skb->data;
if (skb->len < nlh->nlmsg_len || if (skb->len < nlh->nlmsg_len || nlh->nlmsg_len > ND_MAX_MSG_LEN) {
nlh->nlmsg_len > ND_MAX_MSG_LEN) {
netdev_err(skb->dev, "Invalid length (%d,%d)\n", netdev_err(skb->dev, "Invalid length (%d,%d)\n",
skb->len, nlh->nlmsg_len); skb->len, nlh->nlmsg_len);
return; return;

View File

@ -16,8 +16,8 @@
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <net/sock.h> #include <net/sock.h>
struct sock *netlink_init(int unit, struct sock *netlink_init(int unit, void (*cb)(struct net_device *dev, u16 type,
void (*cb)(struct net_device *dev, u16 type, void *msg, int len)); void *msg, int len));
void netlink_exit(struct sock *sock); void netlink_exit(struct sock *sock);
int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len); int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len);

View File

@ -67,6 +67,7 @@ struct fw_info {
static void array_le32_to_cpu(u32 *arr, int num) static void array_le32_to_cpu(u32 *arr, int num)
{ {
int i; int i;
for (i = 0; i < num; i++, arr++) for (i = 0; i < num; i++, arr++)
*arr = __le32_to_cpu(*arr); *arr = __le32_to_cpu(*arr);
} }
@ -105,8 +106,7 @@ static int gdm_wibro_recv(struct usb_device *usbdev, void *data, int len)
return 0; return 0;
} }
static int download_image(struct usb_device *usbdev, static int download_image(struct usb_device *usbdev, const struct firmware *firm,
const struct firmware *firm,
loff_t pos, u32 img_len, u32 magic_num) loff_t pos, u32 img_len, u32 magic_num)
{ {
struct dn_header h; struct dn_header h;
@ -204,8 +204,8 @@ int usb_boot(struct usb_device *usbdev, u16 pid)
goto out; goto out;
} }
ret = download_image(usbdev, firm, pos, ret = download_image(usbdev, firm, pos, fw_info.kernel_len,
fw_info.kernel_len, DN_KERNEL_MAGIC_NUMBER); DN_KERNEL_MAGIC_NUMBER);
if (ret < 0) if (ret < 0)
goto out; goto out;
dev_info(&usbdev->dev, "GCT: Kernel download success.\n"); dev_info(&usbdev->dev, "GCT: Kernel download success.\n");