Commit f4820661 authored by David S. Miller's avatar David S. Miller

Merge branch 'marvell-static-code-analysis'

Markus Elfring says:

====================
Ethernet-Marvell: Fine-tuning for several function implementations

Several update suggestions were taken into account
from static source code analysis.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 5f8ddeab a0c51cf1
...@@ -1107,7 +1107,7 @@ static void mvneta_port_up(struct mvneta_port *pp) ...@@ -1107,7 +1107,7 @@ static void mvneta_port_up(struct mvneta_port *pp)
q_map = 0; q_map = 0;
for (queue = 0; queue < txq_number; queue++) { for (queue = 0; queue < txq_number; queue++) {
struct mvneta_tx_queue *txq = &pp->txqs[queue]; struct mvneta_tx_queue *txq = &pp->txqs[queue];
if (txq->descs != NULL) if (txq->descs)
q_map |= (1 << queue); q_map |= (1 << queue);
} }
mvreg_write(pp, MVNETA_TXQ_CMD, q_map); mvreg_write(pp, MVNETA_TXQ_CMD, q_map);
...@@ -1116,7 +1116,7 @@ static void mvneta_port_up(struct mvneta_port *pp) ...@@ -1116,7 +1116,7 @@ static void mvneta_port_up(struct mvneta_port *pp)
for (queue = 0; queue < rxq_number; queue++) { for (queue = 0; queue < rxq_number; queue++) {
struct mvneta_rx_queue *rxq = &pp->rxqs[queue]; struct mvneta_rx_queue *rxq = &pp->rxqs[queue];
if (rxq->descs != NULL) if (rxq->descs)
q_map |= (1 << queue); q_map |= (1 << queue);
} }
mvreg_write(pp, MVNETA_RXQ_CMD, q_map); mvreg_write(pp, MVNETA_RXQ_CMD, q_map);
...@@ -2850,7 +2850,7 @@ static int mvneta_rxq_init(struct mvneta_port *pp, ...@@ -2850,7 +2850,7 @@ static int mvneta_rxq_init(struct mvneta_port *pp,
rxq->descs = dma_alloc_coherent(pp->dev->dev.parent, rxq->descs = dma_alloc_coherent(pp->dev->dev.parent,
rxq->size * MVNETA_DESC_ALIGNED_SIZE, rxq->size * MVNETA_DESC_ALIGNED_SIZE,
&rxq->descs_phys, GFP_KERNEL); &rxq->descs_phys, GFP_KERNEL);
if (rxq->descs == NULL) if (!rxq->descs)
return -ENOMEM; return -ENOMEM;
rxq->last_desc = rxq->size - 1; rxq->last_desc = rxq->size - 1;
...@@ -2920,7 +2920,7 @@ static int mvneta_txq_init(struct mvneta_port *pp, ...@@ -2920,7 +2920,7 @@ static int mvneta_txq_init(struct mvneta_port *pp,
txq->descs = dma_alloc_coherent(pp->dev->dev.parent, txq->descs = dma_alloc_coherent(pp->dev->dev.parent,
txq->size * MVNETA_DESC_ALIGNED_SIZE, txq->size * MVNETA_DESC_ALIGNED_SIZE,
&txq->descs_phys, GFP_KERNEL); &txq->descs_phys, GFP_KERNEL);
if (txq->descs == NULL) if (!txq->descs)
return -ENOMEM; return -ENOMEM;
txq->last_desc = txq->size - 1; txq->last_desc = txq->size - 1;
...@@ -2933,8 +2933,9 @@ static int mvneta_txq_init(struct mvneta_port *pp, ...@@ -2933,8 +2933,9 @@ static int mvneta_txq_init(struct mvneta_port *pp,
mvreg_write(pp, MVNETA_TXQ_BASE_ADDR_REG(txq->id), txq->descs_phys); mvreg_write(pp, MVNETA_TXQ_BASE_ADDR_REG(txq->id), txq->descs_phys);
mvreg_write(pp, MVNETA_TXQ_SIZE_REG(txq->id), txq->size); mvreg_write(pp, MVNETA_TXQ_SIZE_REG(txq->id), txq->size);
txq->tx_skb = kmalloc(txq->size * sizeof(*txq->tx_skb), GFP_KERNEL); txq->tx_skb = kmalloc_array(txq->size, sizeof(*txq->tx_skb),
if (txq->tx_skb == NULL) { GFP_KERNEL);
if (!txq->tx_skb) {
dma_free_coherent(pp->dev->dev.parent, dma_free_coherent(pp->dev->dev.parent,
txq->size * MVNETA_DESC_ALIGNED_SIZE, txq->size * MVNETA_DESC_ALIGNED_SIZE,
txq->descs, txq->descs_phys); txq->descs, txq->descs_phys);
...@@ -2945,7 +2946,7 @@ static int mvneta_txq_init(struct mvneta_port *pp, ...@@ -2945,7 +2946,7 @@ static int mvneta_txq_init(struct mvneta_port *pp,
txq->tso_hdrs = dma_alloc_coherent(pp->dev->dev.parent, txq->tso_hdrs = dma_alloc_coherent(pp->dev->dev.parent,
txq->size * TSO_HEADER_SIZE, txq->size * TSO_HEADER_SIZE,
&txq->tso_hdrs_phys, GFP_KERNEL); &txq->tso_hdrs_phys, GFP_KERNEL);
if (txq->tso_hdrs == NULL) { if (!txq->tso_hdrs) {
kfree(txq->tx_skb); kfree(txq->tx_skb);
dma_free_coherent(pp->dev->dev.parent, dma_free_coherent(pp->dev->dev.parent,
txq->size * MVNETA_DESC_ALIGNED_SIZE, txq->size * MVNETA_DESC_ALIGNED_SIZE,
...@@ -4002,8 +4003,7 @@ static int mvneta_init(struct device *dev, struct mvneta_port *pp) ...@@ -4002,8 +4003,7 @@ static int mvneta_init(struct device *dev, struct mvneta_port *pp)
/* Set port default values */ /* Set port default values */
mvneta_defaults_set(pp); mvneta_defaults_set(pp);
pp->txqs = devm_kcalloc(dev, txq_number, sizeof(struct mvneta_tx_queue), pp->txqs = devm_kcalloc(dev, txq_number, sizeof(*pp->txqs), GFP_KERNEL);
GFP_KERNEL);
if (!pp->txqs) if (!pp->txqs)
return -ENOMEM; return -ENOMEM;
...@@ -4015,8 +4015,7 @@ static int mvneta_init(struct device *dev, struct mvneta_port *pp) ...@@ -4015,8 +4015,7 @@ static int mvneta_init(struct device *dev, struct mvneta_port *pp)
txq->done_pkts_coal = MVNETA_TXDONE_COAL_PKTS; txq->done_pkts_coal = MVNETA_TXDONE_COAL_PKTS;
} }
pp->rxqs = devm_kcalloc(dev, rxq_number, sizeof(struct mvneta_rx_queue), pp->rxqs = devm_kcalloc(dev, rxq_number, sizeof(*pp->rxqs), GFP_KERNEL);
GFP_KERNEL);
if (!pp->rxqs) if (!pp->rxqs)
return -ENOMEM; return -ENOMEM;
...@@ -4027,8 +4026,10 @@ static int mvneta_init(struct device *dev, struct mvneta_port *pp) ...@@ -4027,8 +4026,10 @@ static int mvneta_init(struct device *dev, struct mvneta_port *pp)
rxq->size = pp->rx_ring_size; rxq->size = pp->rx_ring_size;
rxq->pkts_coal = MVNETA_RX_COAL_PKTS; rxq->pkts_coal = MVNETA_RX_COAL_PKTS;
rxq->time_coal = MVNETA_RX_COAL_USEC; rxq->time_coal = MVNETA_RX_COAL_USEC;
rxq->buf_virt_addr = devm_kmalloc(pp->dev->dev.parent, rxq->buf_virt_addr
rxq->size * sizeof(void *), = devm_kmalloc_array(pp->dev->dev.parent,
rxq->size,
sizeof(*rxq->buf_virt_addr),
GFP_KERNEL); GFP_KERNEL);
if (!rxq->buf_virt_addr) if (!rxq->buf_virt_addr)
return -ENOMEM; return -ENOMEM;
......
...@@ -1689,7 +1689,7 @@ static void mvpp2_prs_mac_drop_all_set(struct mvpp2 *priv, int port, bool add) ...@@ -1689,7 +1689,7 @@ static void mvpp2_prs_mac_drop_all_set(struct mvpp2 *priv, int port, bool add)
mvpp2_prs_hw_read(priv, &pe); mvpp2_prs_hw_read(priv, &pe);
} else { } else {
/* Entry doesn't exist - create new */ /* Entry doesn't exist - create new */
memset(&pe, 0, sizeof(struct mvpp2_prs_entry)); memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_MAC); mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_MAC);
pe.index = MVPP2_PE_DROP_ALL; pe.index = MVPP2_PE_DROP_ALL;
...@@ -1726,7 +1726,7 @@ static void mvpp2_prs_mac_promisc_set(struct mvpp2 *priv, int port, bool add) ...@@ -1726,7 +1726,7 @@ static void mvpp2_prs_mac_promisc_set(struct mvpp2 *priv, int port, bool add)
mvpp2_prs_hw_read(priv, &pe); mvpp2_prs_hw_read(priv, &pe);
} else { } else {
/* Entry doesn't exist - create new */ /* Entry doesn't exist - create new */
memset(&pe, 0, sizeof(struct mvpp2_prs_entry)); memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_MAC); mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_MAC);
pe.index = MVPP2_PE_MAC_PROMISCUOUS; pe.index = MVPP2_PE_MAC_PROMISCUOUS;
...@@ -1772,7 +1772,7 @@ static void mvpp2_prs_mac_multi_set(struct mvpp2 *priv, int port, int index, ...@@ -1772,7 +1772,7 @@ static void mvpp2_prs_mac_multi_set(struct mvpp2 *priv, int port, int index,
mvpp2_prs_hw_read(priv, &pe); mvpp2_prs_hw_read(priv, &pe);
} else { } else {
/* Entry doesn't exist - create new */ /* Entry doesn't exist - create new */
memset(&pe, 0, sizeof(struct mvpp2_prs_entry)); memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_MAC); mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_MAC);
pe.index = index; pe.index = index;
...@@ -1824,7 +1824,7 @@ static void mvpp2_prs_dsa_tag_set(struct mvpp2 *priv, int port, bool add, ...@@ -1824,7 +1824,7 @@ static void mvpp2_prs_dsa_tag_set(struct mvpp2 *priv, int port, bool add,
mvpp2_prs_hw_read(priv, &pe); mvpp2_prs_hw_read(priv, &pe);
} else { } else {
/* Entry doesn't exist - create new */ /* Entry doesn't exist - create new */
memset(&pe, 0, sizeof(struct mvpp2_prs_entry)); memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_DSA); mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_DSA);
pe.index = tid; pe.index = tid;
...@@ -1887,7 +1887,7 @@ static void mvpp2_prs_dsa_tag_ethertype_set(struct mvpp2 *priv, int port, ...@@ -1887,7 +1887,7 @@ static void mvpp2_prs_dsa_tag_ethertype_set(struct mvpp2 *priv, int port,
mvpp2_prs_hw_read(priv, &pe); mvpp2_prs_hw_read(priv, &pe);
} else { } else {
/* Entry doesn't exist - create new */ /* Entry doesn't exist - create new */
memset(&pe, 0, sizeof(struct mvpp2_prs_entry)); memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_DSA); mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_DSA);
pe.index = tid; pe.index = tid;
...@@ -2021,10 +2021,10 @@ static int mvpp2_prs_vlan_add(struct mvpp2 *priv, unsigned short tpid, int ai, ...@@ -2021,10 +2021,10 @@ static int mvpp2_prs_vlan_add(struct mvpp2 *priv, unsigned short tpid, int ai,
if (tid <= tid_aux) { if (tid <= tid_aux) {
ret = -EINVAL; ret = -EINVAL;
goto error; goto free_pe;
} }
memset(pe, 0 , sizeof(struct mvpp2_prs_entry)); memset(pe, 0, sizeof(*pe));
mvpp2_prs_tcam_lu_set(pe, MVPP2_PRS_LU_VLAN); mvpp2_prs_tcam_lu_set(pe, MVPP2_PRS_LU_VLAN);
pe->index = tid; pe->index = tid;
...@@ -2053,8 +2053,7 @@ static int mvpp2_prs_vlan_add(struct mvpp2 *priv, unsigned short tpid, int ai, ...@@ -2053,8 +2053,7 @@ static int mvpp2_prs_vlan_add(struct mvpp2 *priv, unsigned short tpid, int ai,
mvpp2_prs_tcam_port_map_set(pe, port_map); mvpp2_prs_tcam_port_map_set(pe, port_map);
mvpp2_prs_hw_write(priv, pe); mvpp2_prs_hw_write(priv, pe);
free_pe:
error:
kfree(pe); kfree(pe);
return ret; return ret;
...@@ -2139,7 +2138,7 @@ static int mvpp2_prs_double_vlan_add(struct mvpp2 *priv, unsigned short tpid1, ...@@ -2139,7 +2138,7 @@ static int mvpp2_prs_double_vlan_add(struct mvpp2 *priv, unsigned short tpid1,
ai = mvpp2_prs_double_vlan_ai_free_get(priv); ai = mvpp2_prs_double_vlan_ai_free_get(priv);
if (ai < 0) { if (ai < 0) {
ret = ai; ret = ai;
goto error; goto free_pe;
} }
/* Get first single/triple vlan tid */ /* Get first single/triple vlan tid */
...@@ -2162,10 +2161,10 @@ static int mvpp2_prs_double_vlan_add(struct mvpp2 *priv, unsigned short tpid1, ...@@ -2162,10 +2161,10 @@ static int mvpp2_prs_double_vlan_add(struct mvpp2 *priv, unsigned short tpid1,
if (tid >= tid_aux) { if (tid >= tid_aux) {
ret = -ERANGE; ret = -ERANGE;
goto error; goto free_pe;
} }
memset(pe, 0, sizeof(struct mvpp2_prs_entry)); memset(pe, 0, sizeof(*pe));
mvpp2_prs_tcam_lu_set(pe, MVPP2_PRS_LU_VLAN); mvpp2_prs_tcam_lu_set(pe, MVPP2_PRS_LU_VLAN);
pe->index = tid; pe->index = tid;
...@@ -2189,8 +2188,7 @@ static int mvpp2_prs_double_vlan_add(struct mvpp2 *priv, unsigned short tpid1, ...@@ -2189,8 +2188,7 @@ static int mvpp2_prs_double_vlan_add(struct mvpp2 *priv, unsigned short tpid1,
/* Update ports' mask */ /* Update ports' mask */
mvpp2_prs_tcam_port_map_set(pe, port_map); mvpp2_prs_tcam_port_map_set(pe, port_map);
mvpp2_prs_hw_write(priv, pe); mvpp2_prs_hw_write(priv, pe);
free_pe:
error:
kfree(pe); kfree(pe);
return ret; return ret;
} }
...@@ -2212,7 +2210,7 @@ static int mvpp2_prs_ip4_proto(struct mvpp2 *priv, unsigned short proto, ...@@ -2212,7 +2210,7 @@ static int mvpp2_prs_ip4_proto(struct mvpp2 *priv, unsigned short proto,
if (tid < 0) if (tid < 0)
return tid; return tid;
memset(&pe, 0, sizeof(struct mvpp2_prs_entry)); memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_IP4); mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_IP4);
pe.index = tid; pe.index = tid;
...@@ -2270,7 +2268,7 @@ static int mvpp2_prs_ip4_cast(struct mvpp2 *priv, unsigned short l3_cast) ...@@ -2270,7 +2268,7 @@ static int mvpp2_prs_ip4_cast(struct mvpp2 *priv, unsigned short l3_cast)
if (tid < 0) if (tid < 0)
return tid; return tid;
memset(&pe, 0, sizeof(struct mvpp2_prs_entry)); memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_IP4); mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_IP4);
pe.index = tid; pe.index = tid;
...@@ -2326,7 +2324,7 @@ static int mvpp2_prs_ip6_proto(struct mvpp2 *priv, unsigned short proto, ...@@ -2326,7 +2324,7 @@ static int mvpp2_prs_ip6_proto(struct mvpp2 *priv, unsigned short proto,
if (tid < 0) if (tid < 0)
return tid; return tid;
memset(&pe, 0, sizeof(struct mvpp2_prs_entry)); memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_IP6); mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_IP6);
pe.index = tid; pe.index = tid;
...@@ -2365,7 +2363,7 @@ static int mvpp2_prs_ip6_cast(struct mvpp2 *priv, unsigned short l3_cast) ...@@ -2365,7 +2363,7 @@ static int mvpp2_prs_ip6_cast(struct mvpp2 *priv, unsigned short l3_cast)
if (tid < 0) if (tid < 0)
return tid; return tid;
memset(&pe, 0, sizeof(struct mvpp2_prs_entry)); memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_IP6); mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_IP6);
pe.index = tid; pe.index = tid;
...@@ -2425,7 +2423,7 @@ static void mvpp2_prs_def_flow_init(struct mvpp2 *priv) ...@@ -2425,7 +2423,7 @@ static void mvpp2_prs_def_flow_init(struct mvpp2 *priv)
int port; int port;
for (port = 0; port < MVPP2_MAX_PORTS; port++) { for (port = 0; port < MVPP2_MAX_PORTS; port++) {
memset(&pe, 0, sizeof(struct mvpp2_prs_entry)); memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_FLOWS); mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_FLOWS);
pe.index = MVPP2_PE_FIRST_DEFAULT_FLOW - port; pe.index = MVPP2_PE_FIRST_DEFAULT_FLOW - port;
...@@ -2447,7 +2445,7 @@ static void mvpp2_prs_mh_init(struct mvpp2 *priv) ...@@ -2447,7 +2445,7 @@ static void mvpp2_prs_mh_init(struct mvpp2 *priv)
{ {
struct mvpp2_prs_entry pe; struct mvpp2_prs_entry pe;
memset(&pe, 0, sizeof(struct mvpp2_prs_entry)); memset(&pe, 0, sizeof(pe));
pe.index = MVPP2_PE_MH_DEFAULT; pe.index = MVPP2_PE_MH_DEFAULT;
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_MH); mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_MH);
...@@ -2470,7 +2468,7 @@ static void mvpp2_prs_mac_init(struct mvpp2 *priv) ...@@ -2470,7 +2468,7 @@ static void mvpp2_prs_mac_init(struct mvpp2 *priv)
{ {
struct mvpp2_prs_entry pe; struct mvpp2_prs_entry pe;
memset(&pe, 0, sizeof(struct mvpp2_prs_entry)); memset(&pe, 0, sizeof(pe));
/* Non-promiscuous mode for all ports - DROP unknown packets */ /* Non-promiscuous mode for all ports - DROP unknown packets */
pe.index = MVPP2_PE_MAC_NON_PROMISCUOUS; pe.index = MVPP2_PE_MAC_NON_PROMISCUOUS;
...@@ -2531,7 +2529,7 @@ static void mvpp2_prs_dsa_init(struct mvpp2 *priv) ...@@ -2531,7 +2529,7 @@ static void mvpp2_prs_dsa_init(struct mvpp2 *priv)
MVPP2_PRS_TAGGED, MVPP2_PRS_DSA); MVPP2_PRS_TAGGED, MVPP2_PRS_DSA);
/* Set default entry, in case DSA or EDSA tag not found */ /* Set default entry, in case DSA or EDSA tag not found */
memset(&pe, 0, sizeof(struct mvpp2_prs_entry)); memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_DSA); mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_DSA);
pe.index = MVPP2_PE_DSA_DEFAULT; pe.index = MVPP2_PE_DSA_DEFAULT;
mvpp2_prs_sram_next_lu_set(&pe, MVPP2_PRS_LU_VLAN); mvpp2_prs_sram_next_lu_set(&pe, MVPP2_PRS_LU_VLAN);
...@@ -2561,7 +2559,7 @@ static int mvpp2_prs_etype_init(struct mvpp2 *priv) ...@@ -2561,7 +2559,7 @@ static int mvpp2_prs_etype_init(struct mvpp2 *priv)
if (tid < 0) if (tid < 0)
return tid; return tid;
memset(&pe, 0, sizeof(struct mvpp2_prs_entry)); memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_L2); mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_L2);
pe.index = tid; pe.index = tid;
...@@ -2587,7 +2585,7 @@ static int mvpp2_prs_etype_init(struct mvpp2 *priv) ...@@ -2587,7 +2585,7 @@ static int mvpp2_prs_etype_init(struct mvpp2 *priv)
if (tid < 0) if (tid < 0)
return tid; return tid;
memset(&pe, 0, sizeof(struct mvpp2_prs_entry)); memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_L2); mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_L2);
pe.index = tid; pe.index = tid;
...@@ -2617,7 +2615,7 @@ static int mvpp2_prs_etype_init(struct mvpp2 *priv) ...@@ -2617,7 +2615,7 @@ static int mvpp2_prs_etype_init(struct mvpp2 *priv)
if (tid < 0) if (tid < 0)
return tid; return tid;
memset(&pe, 0, sizeof(struct mvpp2_prs_entry)); memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_L2); mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_L2);
pe.index = tid; pe.index = tid;
...@@ -2651,7 +2649,7 @@ static int mvpp2_prs_etype_init(struct mvpp2 *priv) ...@@ -2651,7 +2649,7 @@ static int mvpp2_prs_etype_init(struct mvpp2 *priv)
if (tid < 0) if (tid < 0)
return tid; return tid;
memset(&pe, 0, sizeof(struct mvpp2_prs_entry)); memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_L2); mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_L2);
pe.index = tid; pe.index = tid;
...@@ -2716,7 +2714,7 @@ static int mvpp2_prs_etype_init(struct mvpp2 *priv) ...@@ -2716,7 +2714,7 @@ static int mvpp2_prs_etype_init(struct mvpp2 *priv)
if (tid < 0) if (tid < 0)
return tid; return tid;
memset(&pe, 0, sizeof(struct mvpp2_prs_entry)); memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_L2); mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_L2);
pe.index = tid; pe.index = tid;
...@@ -2813,7 +2811,7 @@ static int mvpp2_prs_vlan_init(struct platform_device *pdev, struct mvpp2 *priv) ...@@ -2813,7 +2811,7 @@ static int mvpp2_prs_vlan_init(struct platform_device *pdev, struct mvpp2 *priv)
return err; return err;
/* Set default double vlan entry */ /* Set default double vlan entry */
memset(&pe, 0, sizeof(struct mvpp2_prs_entry)); memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_VLAN); mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_VLAN);
pe.index = MVPP2_PE_VLAN_DBL; pe.index = MVPP2_PE_VLAN_DBL;
...@@ -2833,7 +2831,7 @@ static int mvpp2_prs_vlan_init(struct platform_device *pdev, struct mvpp2 *priv) ...@@ -2833,7 +2831,7 @@ static int mvpp2_prs_vlan_init(struct platform_device *pdev, struct mvpp2 *priv)
mvpp2_prs_hw_write(priv, &pe); mvpp2_prs_hw_write(priv, &pe);
/* Set default vlan none entry */ /* Set default vlan none entry */
memset(&pe, 0, sizeof(struct mvpp2_prs_entry)); memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_VLAN); mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_VLAN);
pe.index = MVPP2_PE_VLAN_NONE; pe.index = MVPP2_PE_VLAN_NONE;
...@@ -2863,7 +2861,7 @@ static int mvpp2_prs_pppoe_init(struct mvpp2 *priv) ...@@ -2863,7 +2861,7 @@ static int mvpp2_prs_pppoe_init(struct mvpp2 *priv)
if (tid < 0) if (tid < 0)
return tid; return tid;
memset(&pe, 0, sizeof(struct mvpp2_prs_entry)); memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_PPPOE); mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_PPPOE);
pe.index = tid; pe.index = tid;
...@@ -2913,7 +2911,7 @@ static int mvpp2_prs_pppoe_init(struct mvpp2 *priv) ...@@ -2913,7 +2911,7 @@ static int mvpp2_prs_pppoe_init(struct mvpp2 *priv)
if (tid < 0) if (tid < 0)
return tid; return tid;
memset(&pe, 0, sizeof(struct mvpp2_prs_entry)); memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_PPPOE); mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_PPPOE);
pe.index = tid; pe.index = tid;
...@@ -2940,7 +2938,7 @@ static int mvpp2_prs_pppoe_init(struct mvpp2 *priv) ...@@ -2940,7 +2938,7 @@ static int mvpp2_prs_pppoe_init(struct mvpp2 *priv)
if (tid < 0) if (tid < 0)
return tid; return tid;
memset(&pe, 0, sizeof(struct mvpp2_prs_entry)); memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_PPPOE); mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_PPPOE);
pe.index = tid; pe.index = tid;
...@@ -2998,7 +2996,7 @@ static int mvpp2_prs_ip4_init(struct mvpp2 *priv) ...@@ -2998,7 +2996,7 @@ static int mvpp2_prs_ip4_init(struct mvpp2 *priv)
return err; return err;
/* Default IPv4 entry for unknown protocols */ /* Default IPv4 entry for unknown protocols */
memset(&pe, 0, sizeof(struct mvpp2_prs_entry)); memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_IP4); mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_IP4);
pe.index = MVPP2_PE_IP4_PROTO_UN; pe.index = MVPP2_PE_IP4_PROTO_UN;
...@@ -3023,7 +3021,7 @@ static int mvpp2_prs_ip4_init(struct mvpp2 *priv) ...@@ -3023,7 +3021,7 @@ static int mvpp2_prs_ip4_init(struct mvpp2 *priv)
mvpp2_prs_hw_write(priv, &pe); mvpp2_prs_hw_write(priv, &pe);
/* Default IPv4 entry for unicast address */ /* Default IPv4 entry for unicast address */
memset(&pe, 0, sizeof(struct mvpp2_prs_entry)); memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_IP4); mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_IP4);
pe.index = MVPP2_PE_IP4_ADDR_UN; pe.index = MVPP2_PE_IP4_ADDR_UN;
...@@ -3091,7 +3089,7 @@ static int mvpp2_prs_ip6_init(struct mvpp2 *priv) ...@@ -3091,7 +3089,7 @@ static int mvpp2_prs_ip6_init(struct mvpp2 *priv)
if (tid < 0) if (tid < 0)
return tid; return tid;
memset(&pe, 0, sizeof(struct mvpp2_prs_entry)); memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_IP6); mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_IP6);
pe.index = tid; pe.index = tid;
...@@ -3112,7 +3110,7 @@ static int mvpp2_prs_ip6_init(struct mvpp2 *priv) ...@@ -3112,7 +3110,7 @@ static int mvpp2_prs_ip6_init(struct mvpp2 *priv)
mvpp2_prs_hw_write(priv, &pe); mvpp2_prs_hw_write(priv, &pe);
/* Default IPv6 entry for unknown protocols */ /* Default IPv6 entry for unknown protocols */
memset(&pe, 0, sizeof(struct mvpp2_prs_entry)); memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_IP6); mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_IP6);
pe.index = MVPP2_PE_IP6_PROTO_UN; pe.index = MVPP2_PE_IP6_PROTO_UN;
...@@ -3205,7 +3203,7 @@ static int mvpp2_prs_default_init(struct platform_device *pdev, ...@@ -3205,7 +3203,7 @@ static int mvpp2_prs_default_init(struct platform_device *pdev,
mvpp2_prs_hw_inv(priv, index); mvpp2_prs_hw_inv(priv, index);
priv->prs_shadow = devm_kcalloc(&pdev->dev, MVPP2_PRS_TCAM_SRAM_SIZE, priv->prs_shadow = devm_kcalloc(&pdev->dev, MVPP2_PRS_TCAM_SRAM_SIZE,
sizeof(struct mvpp2_prs_shadow), sizeof(*priv->prs_shadow),
GFP_KERNEL); GFP_KERNEL);
if (!priv->prs_shadow) if (!priv->prs_shadow)
return -ENOMEM; return -ENOMEM;
...@@ -3833,7 +3831,7 @@ static int mvpp2_bm_init(struct platform_device *pdev, struct mvpp2 *priv) ...@@ -3833,7 +3831,7 @@ static int mvpp2_bm_init(struct platform_device *pdev, struct mvpp2 *priv)
/* Allocate and initialize BM pools */ /* Allocate and initialize BM pools */
priv->bm_pools = devm_kcalloc(&pdev->dev, MVPP2_BM_POOLS_NUM, priv->bm_pools = devm_kcalloc(&pdev->dev, MVPP2_BM_POOLS_NUM,
sizeof(struct mvpp2_bm_pool), GFP_KERNEL); sizeof(*priv->bm_pools), GFP_KERNEL);
if (!priv->bm_pools) if (!priv->bm_pools)
return -ENOMEM; return -ENOMEM;
...@@ -4417,7 +4415,7 @@ static void mvpp2_egress_enable(struct mvpp2_port *port) ...@@ -4417,7 +4415,7 @@ static void mvpp2_egress_enable(struct mvpp2_port *port)
for (queue = 0; queue < txq_number; queue++) { for (queue = 0; queue < txq_number; queue++) {
struct mvpp2_tx_queue *txq = port->txqs[queue]; struct mvpp2_tx_queue *txq = port->txqs[queue];
if (txq->descs != NULL) if (txq->descs)
qmap |= (1 << queue); qmap |= (1 << queue);
} }
...@@ -5083,11 +5081,11 @@ static int mvpp2_txq_init(struct mvpp2_port *port, ...@@ -5083,11 +5081,11 @@ static int mvpp2_txq_init(struct mvpp2_port *port,
for_each_present_cpu(cpu) { for_each_present_cpu(cpu) {
txq_pcpu = per_cpu_ptr(txq->pcpu, cpu); txq_pcpu = per_cpu_ptr(txq->pcpu, cpu);
txq_pcpu->size = txq->size; txq_pcpu->size = txq->size;
txq_pcpu->buffs = kmalloc(txq_pcpu->size * txq_pcpu->buffs = kmalloc_array(txq_pcpu->size,
sizeof(struct mvpp2_txq_pcpu_buf), sizeof(*txq_pcpu->buffs),
GFP_KERNEL); GFP_KERNEL);
if (!txq_pcpu->buffs) if (!txq_pcpu->buffs)
goto error; goto cleanup;
txq_pcpu->count = 0; txq_pcpu->count = 0;
txq_pcpu->reserved_num = 0; txq_pcpu->reserved_num = 0;
...@@ -5096,8 +5094,7 @@ static int mvpp2_txq_init(struct mvpp2_port *port, ...@@ -5096,8 +5094,7 @@ static int mvpp2_txq_init(struct mvpp2_port *port,
} }
return 0; return 0;
cleanup:
error:
for_each_present_cpu(cpu) { for_each_present_cpu(cpu) {
txq_pcpu = per_cpu_ptr(txq->pcpu, cpu); txq_pcpu = per_cpu_ptr(txq->pcpu, cpu);
kfree(txq_pcpu->buffs); kfree(txq_pcpu->buffs);
...@@ -5515,7 +5512,7 @@ static int mvpp2_rx(struct mvpp2_port *port, int rx_todo, ...@@ -5515,7 +5512,7 @@ static int mvpp2_rx(struct mvpp2_port *port, int rx_todo,
* comprised by the RX descriptor. * comprised by the RX descriptor.
*/ */
if (rx_status & MVPP2_RXD_ERR_SUMMARY) { if (rx_status & MVPP2_RXD_ERR_SUMMARY) {
err_drop_frame: err_drop_frame:
dev->stats.rx_errors++; dev->stats.rx_errors++;
mvpp2_rx_error(port, rx_desc); mvpp2_rx_error(port, rx_desc);
/* Return the buffer to the pool */ /* Return the buffer to the pool */
...@@ -5606,7 +5603,7 @@ static int mvpp2_tx_frag_process(struct mvpp2_port *port, struct sk_buff *skb, ...@@ -5606,7 +5603,7 @@ static int mvpp2_tx_frag_process(struct mvpp2_port *port, struct sk_buff *skb,
DMA_TO_DEVICE); DMA_TO_DEVICE);
if (dma_mapping_error(port->dev->dev.parent, buf_dma_addr)) { if (dma_mapping_error(port->dev->dev.parent, buf_dma_addr)) {
mvpp2_txq_desc_put(txq); mvpp2_txq_desc_put(txq);
goto error; goto cleanup;
} }
mvpp2_txdesc_offset_set(port, tx_desc, mvpp2_txdesc_offset_set(port, tx_desc,
...@@ -5627,8 +5624,7 @@ static int mvpp2_tx_frag_process(struct mvpp2_port *port, struct sk_buff *skb, ...@@ -5627,8 +5624,7 @@ static int mvpp2_tx_frag_process(struct mvpp2_port *port, struct sk_buff *skb,
} }
return 0; return 0;
cleanup:
error:
/* Release all descriptors that were used to map fragments of /* Release all descriptors that were used to map fragments of
* this packet, as well as the corresponding DMA mappings * this packet, as well as the corresponding DMA mappings
*/ */
...@@ -6065,7 +6061,7 @@ static int mvpp2_set_mac_address(struct net_device *dev, void *p) ...@@ -6065,7 +6061,7 @@ static int mvpp2_set_mac_address(struct net_device *dev, void *p)
if (!is_valid_ether_addr(addr->sa_data)) { if (!is_valid_ether_addr(addr->sa_data)) {
err = -EADDRNOTAVAIL; err = -EADDRNOTAVAIL;
goto error; goto log_error;
} }
if (!netif_running(dev)) { if (!netif_running(dev)) {
...@@ -6075,7 +6071,7 @@ static int mvpp2_set_mac_address(struct net_device *dev, void *p) ...@@ -6075,7 +6071,7 @@ static int mvpp2_set_mac_address(struct net_device *dev, void *p)
/* Reconfigure parser to accept the original MAC address */ /* Reconfigure parser to accept the original MAC address */
err = mvpp2_prs_update_mac_da(dev, dev->dev_addr); err = mvpp2_prs_update_mac_da(dev, dev->dev_addr);
if (err) if (err)
goto error; goto log_error;
} }
mvpp2_stop_dev(port); mvpp2_stop_dev(port);
...@@ -6087,15 +6083,14 @@ static int mvpp2_set_mac_address(struct net_device *dev, void *p) ...@@ -6087,15 +6083,14 @@ static int mvpp2_set_mac_address(struct net_device *dev, void *p)
/* Reconfigure parser accept the original MAC address */ /* Reconfigure parser accept the original MAC address */
err = mvpp2_prs_update_mac_da(dev, dev->dev_addr); err = mvpp2_prs_update_mac_da(dev, dev->dev_addr);
if (err) if (err)
goto error; goto log_error;
out_start: out_start:
mvpp2_start_dev(port); mvpp2_start_dev(port);
mvpp2_egress_enable(port); mvpp2_egress_enable(port);
mvpp2_ingress_enable(port); mvpp2_ingress_enable(port);
return 0; return 0;
log_error:
error: netdev_err(dev, "failed to change MAC address\n");
netdev_err(dev, "fail to change MAC address\n");
return err; return err;
} }
...@@ -6120,7 +6115,7 @@ static int mvpp2_change_mtu(struct net_device *dev, int mtu) ...@@ -6120,7 +6115,7 @@ static int mvpp2_change_mtu(struct net_device *dev, int mtu)
/* Reconfigure BM to the original MTU */ /* Reconfigure BM to the original MTU */
err = mvpp2_bm_update_mtu(dev, dev->mtu); err = mvpp2_bm_update_mtu(dev, dev->mtu);
if (err) if (err)
goto error; goto log_error;
} }
mvpp2_stop_dev(port); mvpp2_stop_dev(port);
...@@ -6134,7 +6129,7 @@ static int mvpp2_change_mtu(struct net_device *dev, int mtu) ...@@ -6134,7 +6129,7 @@ static int mvpp2_change_mtu(struct net_device *dev, int mtu)
/* Reconfigure BM to the original MTU */ /* Reconfigure BM to the original MTU */
err = mvpp2_bm_update_mtu(dev, dev->mtu); err = mvpp2_bm_update_mtu(dev, dev->mtu);
if (err) if (err)
goto error; goto log_error;
out_start: out_start:
mvpp2_start_dev(port); mvpp2_start_dev(port);
...@@ -6142,9 +6137,8 @@ static int mvpp2_change_mtu(struct net_device *dev, int mtu) ...@@ -6142,9 +6137,8 @@ static int mvpp2_change_mtu(struct net_device *dev, int mtu)
mvpp2_ingress_enable(port); mvpp2_ingress_enable(port);
return 0; return 0;
log_error:
error: netdev_err(dev, "failed to change MTU\n");
netdev_err(dev, "fail to change MTU\n");
return err; return err;
} }
...@@ -6313,7 +6307,7 @@ static int mvpp2_ethtool_set_ringparam(struct net_device *dev, ...@@ -6313,7 +6307,7 @@ static int mvpp2_ethtool_set_ringparam(struct net_device *dev,
err_clean_rxqs: err_clean_rxqs:
mvpp2_cleanup_rxqs(port); mvpp2_cleanup_rxqs(port);
err_out: err_out:
netdev_err(dev, "fail to change ring parameters"); netdev_err(dev, "failed to change ring parameters");
return err; return err;
} }
...@@ -6487,8 +6481,7 @@ static int mvpp2_port_probe(struct platform_device *pdev, ...@@ -6487,8 +6481,7 @@ static int mvpp2_port_probe(struct platform_device *pdev,
int phy_mode; int phy_mode;
int err, i, cpu; int err, i, cpu;
dev = alloc_etherdev_mqs(sizeof(struct mvpp2_port), txq_number, dev = alloc_etherdev_mqs(sizeof(*port), txq_number, rxq_number);
rxq_number);
if (!dev) if (!dev)
return -ENOMEM; return -ENOMEM;
...@@ -6806,7 +6799,7 @@ static int mvpp2_init(struct platform_device *pdev, struct mvpp2 *priv) ...@@ -6806,7 +6799,7 @@ static int mvpp2_init(struct platform_device *pdev, struct mvpp2 *priv)
/* Allocate and initialize aggregated TXQs */ /* Allocate and initialize aggregated TXQs */
priv->aggr_txqs = devm_kcalloc(&pdev->dev, num_present_cpus(), priv->aggr_txqs = devm_kcalloc(&pdev->dev, num_present_cpus(),
sizeof(struct mvpp2_tx_queue), sizeof(*priv->aggr_txqs),
GFP_KERNEL); GFP_KERNEL);
if (!priv->aggr_txqs) if (!priv->aggr_txqs)
return -ENOMEM; return -ENOMEM;
...@@ -6873,7 +6866,7 @@ static int mvpp2_probe(struct platform_device *pdev) ...@@ -6873,7 +6866,7 @@ static int mvpp2_probe(struct platform_device *pdev)
int port_count, cpu; int port_count, cpu;
int err; int err;
priv = devm_kzalloc(&pdev->dev, sizeof(struct mvpp2), GFP_KERNEL); priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;
...@@ -6970,7 +6963,7 @@ static int mvpp2_probe(struct platform_device *pdev) ...@@ -6970,7 +6963,7 @@ static int mvpp2_probe(struct platform_device *pdev)
} }
priv->port_list = devm_kcalloc(&pdev->dev, port_count, priv->port_list = devm_kcalloc(&pdev->dev, port_count,
sizeof(struct mvpp2_port *), sizeof(*priv->port_list),
GFP_KERNEL); GFP_KERNEL);
if (!priv->port_list) { if (!priv->port_list) {
err = -ENOMEM; err = -ENOMEM;
......
...@@ -556,11 +556,11 @@ static int init_hash_table(struct pxa168_eth_private *pep) ...@@ -556,11 +556,11 @@ static int init_hash_table(struct pxa168_eth_private *pep)
* function.Driver can dynamically switch to them if the 1/2kB hash * function.Driver can dynamically switch to them if the 1/2kB hash
* table is full. * table is full.
*/ */
if (pep->htpr == NULL) { if (!pep->htpr) {
pep->htpr = dma_zalloc_coherent(pep->dev->dev.parent, pep->htpr = dma_zalloc_coherent(pep->dev->dev.parent,
HASH_ADDR_TABLE_SIZE, HASH_ADDR_TABLE_SIZE,
&pep->htpr_dma, GFP_KERNEL); &pep->htpr_dma, GFP_KERNEL);
if (pep->htpr == NULL) if (!pep->htpr)
return -ENOMEM; return -ENOMEM;
} else { } else {
memset(pep->htpr, 0, HASH_ADDR_TABLE_SIZE); memset(pep->htpr, 0, HASH_ADDR_TABLE_SIZE);
...@@ -1036,8 +1036,7 @@ static int rxq_init(struct net_device *dev) ...@@ -1036,8 +1036,7 @@ static int rxq_init(struct net_device *dev)
int rx_desc_num = pep->rx_ring_size; int rx_desc_num = pep->rx_ring_size;
/* Allocate RX skb rings */ /* Allocate RX skb rings */
pep->rx_skb = kzalloc(sizeof(*pep->rx_skb) * pep->rx_ring_size, pep->rx_skb = kcalloc(rx_desc_num, sizeof(*pep->rx_skb), GFP_KERNEL);
GFP_KERNEL);
if (!pep->rx_skb) if (!pep->rx_skb)
return -ENOMEM; return -ENOMEM;
...@@ -1096,8 +1095,7 @@ static int txq_init(struct net_device *dev) ...@@ -1096,8 +1095,7 @@ static int txq_init(struct net_device *dev)
int size = 0, i = 0; int size = 0, i = 0;
int tx_desc_num = pep->tx_ring_size; int tx_desc_num = pep->tx_ring_size;
pep->tx_skb = kzalloc(sizeof(*pep->tx_skb) * pep->tx_ring_size, pep->tx_skb = kcalloc(tx_desc_num, sizeof(*pep->tx_skb), GFP_KERNEL);
GFP_KERNEL);
if (!pep->tx_skb) if (!pep->tx_skb)
return -ENOMEM; return -ENOMEM;
...@@ -1358,7 +1356,7 @@ static int pxa168_smi_write(struct mii_bus *bus, int phy_addr, int regnum, ...@@ -1358,7 +1356,7 @@ static int pxa168_smi_write(struct mii_bus *bus, int phy_addr, int regnum,
static int pxa168_eth_do_ioctl(struct net_device *dev, struct ifreq *ifr, static int pxa168_eth_do_ioctl(struct net_device *dev, struct ifreq *ifr,
int cmd) int cmd)
{ {
if (dev->phydev != NULL) if (dev->phydev)
return phy_mii_ioctl(dev->phydev, ifr, cmd); return phy_mii_ioctl(dev->phydev, ifr, cmd);
return -EOPNOTSUPP; return -EOPNOTSUPP;
...@@ -1503,7 +1501,7 @@ static int pxa168_eth_probe(struct platform_device *pdev) ...@@ -1503,7 +1501,7 @@ static int pxa168_eth_probe(struct platform_device *pdev)
pep->timeout.data = (unsigned long)pep; pep->timeout.data = (unsigned long)pep;
pep->smi_bus = mdiobus_alloc(); pep->smi_bus = mdiobus_alloc();
if (pep->smi_bus == NULL) { if (!pep->smi_bus) {
err = -ENOMEM; err = -ENOMEM;
goto err_netdev; goto err_netdev;
} }
......
...@@ -2657,7 +2657,7 @@ static int skge_down(struct net_device *dev) ...@@ -2657,7 +2657,7 @@ static int skge_down(struct net_device *dev)
struct skge_hw *hw = skge->hw; struct skge_hw *hw = skge->hw;
int port = skge->port; int port = skge->port;
if (skge->mem == NULL) if (!skge->mem)
return 0; return 0;
netif_info(skge, ifdown, skge->netdev, "disabling interface\n"); netif_info(skge, ifdown, skge->netdev, "disabling interface\n");
...@@ -3718,7 +3718,7 @@ static int skge_debug_show(struct seq_file *seq, void *v) ...@@ -3718,7 +3718,7 @@ static int skge_debug_show(struct seq_file *seq, void *v)
t->csum_offs, t->csum_write, t->csum_start); t->csum_offs, t->csum_write, t->csum_start);
} }
seq_printf(seq, "\nRx Ring:\n"); seq_puts(seq, "\nRx Ring:\n");
for (e = skge->rx_ring.to_clean; ; e = e->next) { for (e = skge->rx_ring.to_clean; ; e = e->next) {
const struct skge_rx_desc *r = e->desc; const struct skge_rx_desc *r = e->desc;
......
...@@ -4544,7 +4544,7 @@ static int sky2_debug_show(struct seq_file *seq, void *v) ...@@ -4544,7 +4544,7 @@ static int sky2_debug_show(struct seq_file *seq, void *v)
sky2_read32(hw, B0_Y2_SP_ICR)); sky2_read32(hw, B0_Y2_SP_ICR));
if (!netif_running(dev)) { if (!netif_running(dev)) {
seq_printf(seq, "network not running\n"); seq_puts(seq, "network not running\n");
return 0; return 0;
} }
......
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