Commit 508d2b5d authored by Doug Maxey's avatar Doug Maxey Committed by David S. Miller

ehea: fix main checkpatch complaints

Cc: Jan-Bernd Themann <themann@de.ibm.com>
Signed-off-by: default avatarDoug Maxey <dwm@austin.ibm.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 13da93d4
...@@ -54,11 +54,11 @@ static int rq1_entries = EHEA_DEF_ENTRIES_RQ1; ...@@ -54,11 +54,11 @@ static int rq1_entries = EHEA_DEF_ENTRIES_RQ1;
static int rq2_entries = EHEA_DEF_ENTRIES_RQ2; static int rq2_entries = EHEA_DEF_ENTRIES_RQ2;
static int rq3_entries = EHEA_DEF_ENTRIES_RQ3; static int rq3_entries = EHEA_DEF_ENTRIES_RQ3;
static int sq_entries = EHEA_DEF_ENTRIES_SQ; static int sq_entries = EHEA_DEF_ENTRIES_SQ;
static int use_mcs = 0; static int use_mcs;
static int use_lro = 0; static int use_lro;
static int lro_max_aggr = EHEA_LRO_MAX_AGGR; static int lro_max_aggr = EHEA_LRO_MAX_AGGR;
static int num_tx_qps = EHEA_NUM_TX_QP; static int num_tx_qps = EHEA_NUM_TX_QP;
static int prop_carrier_state = 0; static int prop_carrier_state;
module_param(msg_level, int, 0); module_param(msg_level, int, 0);
module_param(rq1_entries, int, 0); module_param(rq1_entries, int, 0);
...@@ -94,9 +94,9 @@ MODULE_PARM_DESC(lro_max_aggr, " LRO: Max packets to be aggregated. Default = " ...@@ -94,9 +94,9 @@ MODULE_PARM_DESC(lro_max_aggr, " LRO: Max packets to be aggregated. Default = "
MODULE_PARM_DESC(use_lro, " Large Receive Offload, 1: enable, 0: disable, " MODULE_PARM_DESC(use_lro, " Large Receive Offload, 1: enable, 0: disable, "
"Default = 0"); "Default = 0");
static int port_name_cnt = 0; static int port_name_cnt;
static LIST_HEAD(adapter_list); static LIST_HEAD(adapter_list);
u64 ehea_driver_flags = 0; u64 ehea_driver_flags;
struct work_struct ehea_rereg_mr_task; struct work_struct ehea_rereg_mr_task;
struct semaphore dlpar_mem_lock; struct semaphore dlpar_mem_lock;
...@@ -121,12 +121,13 @@ static struct of_platform_driver ehea_driver = { ...@@ -121,12 +121,13 @@ static struct of_platform_driver ehea_driver = {
.remove = ehea_remove, .remove = ehea_remove,
}; };
void ehea_dump(void *adr, int len, char *msg) { void ehea_dump(void *adr, int len, char *msg)
{
int x; int x;
unsigned char *deb = adr; unsigned char *deb = adr;
for (x = 0; x < len; x += 16) { for (x = 0; x < len; x += 16) {
printk(DRV_NAME " %s adr=%p ofs=%04x %016lx %016lx\n", msg, printk(DRV_NAME " %s adr=%p ofs=%04x %016lx %016lx\n", msg,
deb, x, *((u64*)&deb[0]), *((u64*)&deb[8])); deb, x, *((u64 *)&deb[0]), *((u64 *)&deb[8]));
deb += 16; deb += 16;
} }
} }
...@@ -518,7 +519,8 @@ static int ehea_proc_rwqes(struct net_device *dev, ...@@ -518,7 +519,8 @@ static int ehea_proc_rwqes(struct net_device *dev,
last_wqe_index = wqe_index; last_wqe_index = wqe_index;
rmb(); rmb();
if (!ehea_check_cqe(cqe, &rq)) { if (!ehea_check_cqe(cqe, &rq)) {
if (rq == 1) { /* LL RQ1 */ if (rq == 1) {
/* LL RQ1 */
skb = get_skb_by_index_ll(skb_arr_rq1, skb = get_skb_by_index_ll(skb_arr_rq1,
skb_arr_rq1_len, skb_arr_rq1_len,
wqe_index); wqe_index);
...@@ -531,10 +533,11 @@ static int ehea_proc_rwqes(struct net_device *dev, ...@@ -531,10 +533,11 @@ static int ehea_proc_rwqes(struct net_device *dev,
if (!skb) if (!skb)
break; break;
} }
skb_copy_to_linear_data(skb, ((char*)cqe) + 64, skb_copy_to_linear_data(skb, ((char *)cqe) + 64,
cqe->num_bytes_transfered - 4); cqe->num_bytes_transfered - 4);
ehea_fill_skb(dev, skb, cqe); ehea_fill_skb(dev, skb, cqe);
} else if (rq == 2) { /* RQ2 */ } else if (rq == 2) {
/* RQ2 */
skb = get_skb_by_index(skb_arr_rq2, skb = get_skb_by_index(skb_arr_rq2,
skb_arr_rq2_len, cqe); skb_arr_rq2_len, cqe);
if (unlikely(!skb)) { if (unlikely(!skb)) {
...@@ -544,7 +547,8 @@ static int ehea_proc_rwqes(struct net_device *dev, ...@@ -544,7 +547,8 @@ static int ehea_proc_rwqes(struct net_device *dev,
} }
ehea_fill_skb(dev, skb, cqe); ehea_fill_skb(dev, skb, cqe);
processed_rq2++; processed_rq2++;
} else { /* RQ3 */ } else {
/* RQ3 */
skb = get_skb_by_index(skb_arr_rq3, skb = get_skb_by_index(skb_arr_rq3,
skb_arr_rq3_len, cqe); skb_arr_rq3_len, cqe);
if (unlikely(!skb)) { if (unlikely(!skb)) {
...@@ -592,7 +596,7 @@ static struct ehea_cqe *ehea_proc_cqes(struct ehea_port_res *pr, int my_quota) ...@@ -592,7 +596,7 @@ static struct ehea_cqe *ehea_proc_cqes(struct ehea_port_res *pr, int my_quota)
unsigned long flags; unsigned long flags;
cqe = ehea_poll_cq(send_cq); cqe = ehea_poll_cq(send_cq);
while(cqe && (quota > 0)) { while (cqe && (quota > 0)) {
ehea_inc_cq(send_cq); ehea_inc_cq(send_cq);
cqe_counter++; cqe_counter++;
...@@ -643,7 +647,8 @@ static struct ehea_cqe *ehea_proc_cqes(struct ehea_port_res *pr, int my_quota) ...@@ -643,7 +647,8 @@ static struct ehea_cqe *ehea_proc_cqes(struct ehea_port_res *pr, int my_quota)
static int ehea_poll(struct napi_struct *napi, int budget) static int ehea_poll(struct napi_struct *napi, int budget)
{ {
struct ehea_port_res *pr = container_of(napi, struct ehea_port_res, napi); struct ehea_port_res *pr = container_of(napi, struct ehea_port_res,
napi);
struct net_device *dev = pr->port->netdev; struct net_device *dev = pr->port->netdev;
struct ehea_cqe *cqe; struct ehea_cqe *cqe;
struct ehea_cqe *cqe_skb = NULL; struct ehea_cqe *cqe_skb = NULL;
...@@ -743,8 +748,9 @@ int ehea_sense_port_attr(struct ehea_port *port) ...@@ -743,8 +748,9 @@ int ehea_sense_port_attr(struct ehea_port *port)
u64 hret; u64 hret;
struct hcp_ehea_port_cb0 *cb0; struct hcp_ehea_port_cb0 *cb0;
cb0 = kzalloc(PAGE_SIZE, GFP_ATOMIC); /* May be called via */ /* may be called via ehea_neq_tasklet() */
if (!cb0) { /* ehea_neq_tasklet() */ cb0 = kzalloc(PAGE_SIZE, GFP_ATOMIC);
if (!cb0) {
ehea_error("no mem for cb0"); ehea_error("no mem for cb0");
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
...@@ -762,7 +768,7 @@ int ehea_sense_port_attr(struct ehea_port *port) ...@@ -762,7 +768,7 @@ int ehea_sense_port_attr(struct ehea_port *port)
/* MAC address */ /* MAC address */
port->mac_addr = cb0->port_mac_addr << 16; port->mac_addr = cb0->port_mac_addr << 16;
if (!is_valid_ether_addr((u8*)&port->mac_addr)) { if (!is_valid_ether_addr((u8 *)&port->mac_addr)) {
ret = -EADDRNOTAVAIL; ret = -EADDRNOTAVAIL;
goto out_free; goto out_free;
} }
...@@ -994,7 +1000,7 @@ static void ehea_parse_eqe(struct ehea_adapter *adapter, u64 eqe) ...@@ -994,7 +1000,7 @@ static void ehea_parse_eqe(struct ehea_adapter *adapter, u64 eqe)
static void ehea_neq_tasklet(unsigned long data) static void ehea_neq_tasklet(unsigned long data)
{ {
struct ehea_adapter *adapter = (struct ehea_adapter*)data; struct ehea_adapter *adapter = (struct ehea_adapter *)data;
struct ehea_eqe *eqe; struct ehea_eqe *eqe;
u64 event_mask; u64 event_mask;
...@@ -1204,7 +1210,7 @@ int ehea_rem_smrs(struct ehea_port_res *pr) ...@@ -1204,7 +1210,7 @@ int ehea_rem_smrs(struct ehea_port_res *pr)
static int ehea_init_q_skba(struct ehea_q_skb_arr *q_skba, int max_q_entries) static int ehea_init_q_skba(struct ehea_q_skb_arr *q_skba, int max_q_entries)
{ {
int arr_size = sizeof(void*) * max_q_entries; int arr_size = sizeof(void *) * max_q_entries;
q_skba->arr = vmalloc(arr_size); q_skba->arr = vmalloc(arr_size);
if (!q_skba->arr) if (!q_skba->arr)
...@@ -1489,7 +1495,7 @@ static inline void write_swqe2_data(struct sk_buff *skb, struct net_device *dev, ...@@ -1489,7 +1495,7 @@ static inline void write_swqe2_data(struct sk_buff *skb, struct net_device *dev,
nfrags = skb_shinfo(skb)->nr_frags; nfrags = skb_shinfo(skb)->nr_frags;
sg1entry = &swqe->u.immdata_desc.sg_entry; sg1entry = &swqe->u.immdata_desc.sg_entry;
sg_list = (struct ehea_vsgentry*)&swqe->u.immdata_desc.sg_list; sg_list = (struct ehea_vsgentry *)&swqe->u.immdata_desc.sg_list;
swqe->descriptors = 0; swqe->descriptors = 0;
sg1entry_contains_frag_data = 0; sg1entry_contains_frag_data = 0;
...@@ -1732,7 +1738,7 @@ static void ehea_allmulti(struct net_device *dev, int enable) ...@@ -1732,7 +1738,7 @@ static void ehea_allmulti(struct net_device *dev, int enable)
} }
} }
static void ehea_add_multicast_entry(struct ehea_port* port, u8* mc_mac_addr) static void ehea_add_multicast_entry(struct ehea_port *port, u8 *mc_mac_addr)
{ {
struct ehea_mc_list *ehea_mcl_entry; struct ehea_mc_list *ehea_mcl_entry;
u64 hret; u64 hret;
...@@ -1791,11 +1797,10 @@ static void ehea_set_multicast_list(struct net_device *dev) ...@@ -1791,11 +1797,10 @@ static void ehea_set_multicast_list(struct net_device *dev)
goto out; goto out;
} }
for (i = 0, k_mcl_entry = dev->mc_list; for (i = 0, k_mcl_entry = dev->mc_list; i < dev->mc_count; i++,
i < dev->mc_count; k_mcl_entry = k_mcl_entry->next)
i++, k_mcl_entry = k_mcl_entry->next) {
ehea_add_multicast_entry(port, k_mcl_entry->dmi_addr); ehea_add_multicast_entry(port, k_mcl_entry->dmi_addr);
}
} }
out: out:
return; return;
...@@ -1925,12 +1930,12 @@ static inline int ehea_hash_skb(struct sk_buff *skb, int num_qps) ...@@ -1925,12 +1930,12 @@ static inline int ehea_hash_skb(struct sk_buff *skb, int num_qps)
if ((skb->protocol == htons(ETH_P_IP)) && if ((skb->protocol == htons(ETH_P_IP)) &&
(ip_hdr(skb)->protocol == IPPROTO_TCP)) { (ip_hdr(skb)->protocol == IPPROTO_TCP)) {
tcp = (struct tcphdr*)(skb_network_header(skb) + (ip_hdr(skb)->ihl * 4)); tcp = (struct tcphdr *)(skb_network_header(skb) +
(ip_hdr(skb)->ihl * 4));
tmp = (tcp->source + (tcp->dest << 16)) % 31; tmp = (tcp->source + (tcp->dest << 16)) % 31;
tmp += ip_hdr(skb)->daddr % 31; tmp += ip_hdr(skb)->daddr % 31;
return tmp % num_qps; return tmp % num_qps;
} } else
else
return 0; return 0;
} }
...@@ -2122,7 +2127,7 @@ int ehea_activate_qp(struct ehea_adapter *adapter, struct ehea_qp *qp) ...@@ -2122,7 +2127,7 @@ int ehea_activate_qp(struct ehea_adapter *adapter, struct ehea_qp *qp)
u64 hret; u64 hret;
u16 dummy16 = 0; u16 dummy16 = 0;
u64 dummy64 = 0; u64 dummy64 = 0;
struct hcp_modify_qp_cb0* cb0; struct hcp_modify_qp_cb0 *cb0;
cb0 = kzalloc(PAGE_SIZE, GFP_KERNEL); cb0 = kzalloc(PAGE_SIZE, GFP_KERNEL);
if (!cb0) { if (!cb0) {
...@@ -2248,7 +2253,7 @@ static int ehea_clean_all_portres(struct ehea_port *port) ...@@ -2248,7 +2253,7 @@ static int ehea_clean_all_portres(struct ehea_port *port)
int ret = 0; int ret = 0;
int i; int i;
for(i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++)
ret |= ehea_clean_portres(port, &port->port_res[i]); ret |= ehea_clean_portres(port, &port->port_res[i]);
ret |= ehea_destroy_eq(port->qp_eq); ret |= ehea_destroy_eq(port->qp_eq);
...@@ -2300,7 +2305,7 @@ static int ehea_up(struct net_device *dev) ...@@ -2300,7 +2305,7 @@ static int ehea_up(struct net_device *dev)
goto out_clean_pr; goto out_clean_pr;
} }
for(i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) { for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
ret = ehea_activate_qp(port->adapter, port->port_res[i].qp); ret = ehea_activate_qp(port->adapter, port->port_res[i].qp);
if (ret) { if (ret) {
ehea_error("activate_qp failed"); ehea_error("activate_qp failed");
...@@ -2308,7 +2313,7 @@ static int ehea_up(struct net_device *dev) ...@@ -2308,7 +2313,7 @@ static int ehea_up(struct net_device *dev)
} }
} }
for(i = 0; i < port->num_def_qps; i++) { for (i = 0; i < port->num_def_qps; i++) {
ret = ehea_fill_port_res(&port->port_res[i]); ret = ehea_fill_port_res(&port->port_res[i]);
if (ret) { if (ret) {
ehea_error("out_free_irqs"); ehea_error("out_free_irqs");
...@@ -2425,7 +2430,7 @@ int ehea_stop_qps(struct net_device *dev) ...@@ -2425,7 +2430,7 @@ int ehea_stop_qps(struct net_device *dev)
{ {
struct ehea_port *port = netdev_priv(dev); struct ehea_port *port = netdev_priv(dev);
struct ehea_adapter *adapter = port->adapter; struct ehea_adapter *adapter = port->adapter;
struct hcp_modify_qp_cb0* cb0; struct hcp_modify_qp_cb0 *cb0;
int ret = -EIO; int ret = -EIO;
int dret; int dret;
int i; int i;
...@@ -2490,7 +2495,7 @@ int ehea_stop_qps(struct net_device *dev) ...@@ -2490,7 +2495,7 @@ int ehea_stop_qps(struct net_device *dev)
return ret; return ret;
} }
void ehea_update_rqs(struct ehea_qp *orig_qp, struct ehea_port_res * pr) void ehea_update_rqs(struct ehea_qp *orig_qp, struct ehea_port_res *pr)
{ {
struct ehea_qp qp = *orig_qp; struct ehea_qp qp = *orig_qp;
struct ehea_qp_init_attr *init_attr = &qp.init_attr; struct ehea_qp_init_attr *init_attr = &qp.init_attr;
...@@ -2530,7 +2535,7 @@ int ehea_restart_qps(struct net_device *dev) ...@@ -2530,7 +2535,7 @@ int ehea_restart_qps(struct net_device *dev)
int ret = 0; int ret = 0;
int i; int i;
struct hcp_modify_qp_cb0* cb0; struct hcp_modify_qp_cb0 *cb0;
u64 hret; u64 hret;
u64 dummy64 = 0; u64 dummy64 = 0;
u16 dummy16 = 0; u16 dummy16 = 0;
...@@ -3109,7 +3114,7 @@ static ssize_t ehea_probe_port(struct device *dev, ...@@ -3109,7 +3114,7 @@ static ssize_t ehea_probe_port(struct device *dev,
of_node_put(eth_dn); of_node_put(eth_dn);
if (port) { if (port) {
for (i=0; i < EHEA_MAX_PORTS; i++) for (i = 0; i < EHEA_MAX_PORTS; i++)
if (!adapter->port[i]) { if (!adapter->port[i]) {
adapter->port[i] = port; adapter->port[i] = port;
break; break;
...@@ -3144,7 +3149,7 @@ static ssize_t ehea_remove_port(struct device *dev, ...@@ -3144,7 +3149,7 @@ static ssize_t ehea_remove_port(struct device *dev,
ehea_shutdown_single_port(port); ehea_shutdown_single_port(port);
for (i=0; i < EHEA_MAX_PORTS; i++) for (i = 0; i < EHEA_MAX_PORTS; i++)
if (adapter->port[i] == port) { if (adapter->port[i] == port) {
adapter->port[i] = NULL; adapter->port[i] = NULL;
break; break;
......
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