* [PATCH 01/10] staging: octeon: Move logical operators on the correct line
2016-02-27 23:41 [PATCH 00/10] staging: octeon: Fix several checkpatch issues Laura Garcia Liebana
@ 2016-02-27 23:41 ` Laura Garcia Liebana
2016-02-27 23:42 ` [PATCH 02/10] staging: octeon: Fix alignment with open parenthesis Laura Garcia Liebana
` (8 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Laura Garcia Liebana @ 2016-02-27 23:41 UTC (permalink / raw)
To: outreachy-kernel
Logical continuations should be on the previous line. Checkpatch detected this issue.
Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
---
drivers/staging/octeon/ethernet-tx.c | 8 ++++----
drivers/staging/octeon/ethernet.c | 24 ++++++++++++------------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/staging/octeon/ethernet-tx.c b/drivers/staging/octeon/ethernet-tx.c
index e229ebf..94b0e67 100644
--- a/drivers/staging/octeon/ethernet-tx.c
+++ b/drivers/staging/octeon/ethernet-tx.c
@@ -618,8 +618,8 @@ int cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev)
work->word2.s.dec_ipcomp = 0; /* FIXME */
#endif
work->word2.s.tcp_or_udp =
- (ip_hdr(skb)->protocol == IPPROTO_TCP)
- || (ip_hdr(skb)->protocol == IPPROTO_UDP);
+ (ip_hdr(skb)->protocol == IPPROTO_TCP) ||
+ (ip_hdr(skb)->protocol == IPPROTO_UDP);
#if 0
/* FIXME */
work->word2.s.dec_ipsec = 0;
@@ -630,8 +630,8 @@ int cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev)
/* No error, packet is internal */
work->word2.s.L4_error = 0;
#endif
- work->word2.s.is_frag = !((ip_hdr(skb)->frag_off == 0)
- || (ip_hdr(skb)->frag_off ==
+ work->word2.s.is_frag = !((ip_hdr(skb)->frag_off == 0) ||
+ (ip_hdr(skb)->frag_off ==
1 << 14));
#if 0
/* Assume Linux is sending a good packet */
diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
index 00adc52..91f2dd6 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -254,22 +254,22 @@ static int cvm_oct_common_change_mtu(struct net_device *dev, int new_mtu)
* Limit the MTU to make sure the ethernet packets are between
* 64 bytes and 65535 bytes.
*/
- if ((new_mtu + 14 + 4 + vlan_bytes < 64)
- || (new_mtu + 14 + 4 + vlan_bytes > 65392)) {
+ if ((new_mtu + 14 + 4 + vlan_bytes < 64) ||
+ (new_mtu + 14 + 4 + vlan_bytes > 65392)) {
pr_err("MTU must be between %d and %d.\n",
64 - 14 - 4 - vlan_bytes, 65392 - 14 - 4 - vlan_bytes);
return -EINVAL;
}
dev->mtu = new_mtu;
- if ((interface < 2)
- && (cvmx_helper_interface_get_mode(interface) !=
+ if ((interface < 2) &&
+ (cvmx_helper_interface_get_mode(interface) !=
CVMX_HELPER_INTERFACE_MODE_SPI)) {
/* Add ethernet header and FCS, and VLAN if configured. */
int max_packet = new_mtu + 14 + 4 + vlan_bytes;
- if (OCTEON_IS_MODEL(OCTEON_CN3XXX)
- || OCTEON_IS_MODEL(OCTEON_CN58XX)) {
+ if (OCTEON_IS_MODEL(OCTEON_CN3XXX) ||
+ OCTEON_IS_MODEL(OCTEON_CN58XX)) {
/* Signal errors on packets larger than the MTU */
cvmx_write_csr(CVMX_GMXX_RXX_FRM_MAX(index, interface),
max_packet);
@@ -308,8 +308,8 @@ static void cvm_oct_common_set_multicast_list(struct net_device *dev)
int interface = INTERFACE(priv->port);
int index = INDEX(priv->port);
- if ((interface < 2)
- && (cvmx_helper_interface_get_mode(interface) !=
+ if ((interface < 2) &&
+ (cvmx_helper_interface_get_mode(interface) !=
CVMX_HELPER_INTERFACE_MODE_SPI)) {
union cvmx_gmxx_rxx_adr_ctl control;
@@ -360,8 +360,8 @@ static int cvm_oct_set_mac_filter(struct net_device *dev)
int interface = INTERFACE(priv->port);
int index = INDEX(priv->port);
- if ((interface < 2)
- && (cvmx_helper_interface_get_mode(interface) !=
+ if ((interface < 2) &&
+ (cvmx_helper_interface_get_mode(interface) !=
CVMX_HELPER_INTERFACE_MODE_SPI)) {
int i;
u8 *ptr = dev->dev_addr;
@@ -434,8 +434,8 @@ int cvm_oct_common_init(struct net_device *dev)
* Force the interface to use the POW send if always_use_pow
* was specified or it is in the pow send list.
*/
- if ((pow_send_group != -1)
- && (always_use_pow || strstr(pow_send_list, dev->name)))
+ if ((pow_send_group != -1) &&
+ (always_use_pow || strstr(pow_send_list, dev->name)))
priv->queue = -1;
if (priv->queue != -1)
--
2.7.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 02/10] staging: octeon: Fix alignment with open parenthesis
2016-02-27 23:41 [PATCH 00/10] staging: octeon: Fix several checkpatch issues Laura Garcia Liebana
2016-02-27 23:41 ` [PATCH 01/10] staging: octeon: Move logical operators on the correct line Laura Garcia Liebana
@ 2016-02-27 23:42 ` Laura Garcia Liebana
2016-03-11 18:13 ` [Outreachy kernel] " Greg KH
2016-02-27 23:42 ` [PATCH 03/10] staging: octeon: Insert blank line after struct declaration Laura Garcia Liebana
` (7 subsequent siblings)
9 siblings, 1 reply; 13+ messages in thread
From: Laura Garcia Liebana @ 2016-02-27 23:42 UTC (permalink / raw)
To: outreachy-kernel
Alignment should match open parenthesis. Checkpatch detected these
issues.
Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
---
drivers/staging/octeon/ethernet-rx.c | 7 ++++---
drivers/staging/octeon/ethernet-rx.h | 2 +-
drivers/staging/octeon/ethernet-tx.c | 5 +++--
drivers/staging/octeon/ethernet.c | 9 +++++----
4 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
index ed55304..c35f4ef 100644
--- a/drivers/staging/octeon/ethernet-rx.c
+++ b/drivers/staging/octeon/ethernet-rx.c
@@ -182,12 +182,13 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
if (OCTEON_IS_MODEL(OCTEON_CN68XX)) {
old_group_mask = cvmx_read_csr(CVMX_SSO_PPX_GRP_MSK(coreid));
cvmx_write_csr(CVMX_SSO_PPX_GRP_MSK(coreid),
- 1ull << pow_receive_group);
+ 1ull << pow_receive_group);
cvmx_read_csr(CVMX_SSO_PPX_GRP_MSK(coreid)); /* Flush */
} else {
old_group_mask = cvmx_read_csr(CVMX_POW_PP_GRP_MSKX(coreid));
cvmx_write_csr(CVMX_POW_PP_GRP_MSKX(coreid),
- (old_group_mask & ~0xFFFFull) | 1 << pow_receive_group);
+ (old_group_mask & ~0xFFFFull) |
+ 1 << pow_receive_group);
}
if (USE_ASYNC_IOBDMA) {
@@ -381,7 +382,7 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
* doesn't exist.
*/
printk_ratelimited("Port %d not controlled by Linux, packet dropped\n",
- port);
+ port);
dev_kfree_skb_irq(skb);
}
/*
diff --git a/drivers/staging/octeon/ethernet-rx.h b/drivers/staging/octeon/ethernet-rx.h
index a5973fd..315a63d 100644
--- a/drivers/staging/octeon/ethernet-rx.h
+++ b/drivers/staging/octeon/ethernet-rx.h
@@ -30,7 +30,7 @@ static inline void cvm_oct_rx_refill_pool(int fill_threshold)
number_to_free);
if (num_freed != number_to_free) {
cvmx_fau_atomic_add32(FAU_NUM_PACKET_BUFFERS_TO_FREE,
- number_to_free - num_freed);
+ number_to_free - num_freed);
}
}
}
diff --git a/drivers/staging/octeon/ethernet-tx.c b/drivers/staging/octeon/ethernet-tx.c
index 94b0e67..82e60ae 100644
--- a/drivers/staging/octeon/ethernet-tx.c
+++ b/drivers/staging/octeon/ethernet-tx.c
@@ -221,7 +221,8 @@ int cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev)
priv->fau + qos * 4, MAX_SKB_TO_FREE);
}
skb_to_free = cvm_oct_adjust_skb_to_free(skb_to_free,
- priv->fau + qos * 4);
+ priv->fau +
+ qos * 4);
spin_lock_irqsave(&priv->tx_free_list[qos].lock, flags);
goto skip_xmit;
}
@@ -420,7 +421,7 @@ dont_put_skbuff_in_hw:
}
skb_to_free = cvm_oct_adjust_skb_to_free(skb_to_free,
- priv->fau + qos * 4);
+ priv->fau + qos * 4);
/*
* If we're sending faster than the receive can free them then
diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
index 91f2dd6..8935556 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -139,7 +139,7 @@ static void cvm_oct_periodic_worker(struct work_struct *work)
if (!atomic_read(&cvm_oct_poll_queue_stopping))
queue_delayed_work(cvm_oct_poll_queue,
- &priv->port_periodic_work, HZ);
+ &priv->port_periodic_work, HZ);
}
static void cvm_oct_configure_common_hw(void)
@@ -636,7 +636,7 @@ static struct device_node *cvm_oct_of_get_child(
}
static struct device_node *cvm_oct_node_for_port(struct device_node *pip,
- int interface, int port)
+ int interface, int port)
{
struct device_node *ni, *np;
@@ -821,7 +821,7 @@ static int cvm_oct_probe(struct platform_device *pdev)
free_netdev(dev);
} else if (register_netdev(dev) < 0) {
pr_err("Failed to register ethernet device for interface %d, port %d\n",
- interface, priv->port);
+ interface, priv->port);
free_netdev(dev);
} else {
cvm_oct_device[priv->port] = dev;
@@ -829,7 +829,8 @@ static int cvm_oct_probe(struct platform_device *pdev)
cvmx_pko_get_num_queues(priv->port) *
sizeof(u32);
queue_delayed_work(cvm_oct_poll_queue,
- &priv->port_periodic_work, HZ);
+ &priv->port_periodic_work,
+ HZ);
}
}
}
--
2.7.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 03/10] staging: octeon: Insert blank line after struct declaration
2016-02-27 23:41 [PATCH 00/10] staging: octeon: Fix several checkpatch issues Laura Garcia Liebana
2016-02-27 23:41 ` [PATCH 01/10] staging: octeon: Move logical operators on the correct line Laura Garcia Liebana
2016-02-27 23:42 ` [PATCH 02/10] staging: octeon: Fix alignment with open parenthesis Laura Garcia Liebana
@ 2016-02-27 23:42 ` Laura Garcia Liebana
2016-02-27 23:43 ` [PATCH 04/10] staging: octeon: Remove comparison to NULL Laura Garcia Liebana
` (6 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Laura Garcia Liebana @ 2016-02-27 23:42 UTC (permalink / raw)
To: outreachy-kernel
Blank line is inserted after a struct declaration. Checkpatch detected
these issues.
Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
---
drivers/staging/octeon/ethernet.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
index 8935556..b49e55a 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -546,6 +546,7 @@ static const struct net_device_ops cvm_oct_npi_netdev_ops = {
.ndo_poll_controller = cvm_oct_poll_controller,
#endif
};
+
static const struct net_device_ops cvm_oct_xaui_netdev_ops = {
.ndo_init = cvm_oct_common_init,
.ndo_uninit = cvm_oct_common_uninit,
@@ -561,6 +562,7 @@ static const struct net_device_ops cvm_oct_xaui_netdev_ops = {
.ndo_poll_controller = cvm_oct_poll_controller,
#endif
};
+
static const struct net_device_ops cvm_oct_sgmii_netdev_ops = {
.ndo_init = cvm_oct_sgmii_init,
.ndo_uninit = cvm_oct_common_uninit,
@@ -576,6 +578,7 @@ static const struct net_device_ops cvm_oct_sgmii_netdev_ops = {
.ndo_poll_controller = cvm_oct_poll_controller,
#endif
};
+
static const struct net_device_ops cvm_oct_spi_netdev_ops = {
.ndo_init = cvm_oct_spi_init,
.ndo_uninit = cvm_oct_spi_uninit,
@@ -589,6 +592,7 @@ static const struct net_device_ops cvm_oct_spi_netdev_ops = {
.ndo_poll_controller = cvm_oct_poll_controller,
#endif
};
+
static const struct net_device_ops cvm_oct_rgmii_netdev_ops = {
.ndo_init = cvm_oct_common_init,
.ndo_uninit = cvm_oct_common_uninit,
@@ -604,6 +608,7 @@ static const struct net_device_ops cvm_oct_rgmii_netdev_ops = {
.ndo_poll_controller = cvm_oct_poll_controller,
#endif
};
+
static const struct net_device_ops cvm_oct_pow_netdev_ops = {
.ndo_init = cvm_oct_common_init,
.ndo_start_xmit = cvm_oct_xmit_pow,
--
2.7.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 04/10] staging: octeon: Remove comparison to NULL
2016-02-27 23:41 [PATCH 00/10] staging: octeon: Fix several checkpatch issues Laura Garcia Liebana
` (2 preceding siblings ...)
2016-02-27 23:42 ` [PATCH 03/10] staging: octeon: Insert blank line after struct declaration Laura Garcia Liebana
@ 2016-02-27 23:43 ` Laura Garcia Liebana
2016-02-27 23:43 ` [PATCH 05/10] staging: octeon: Fix block comments Laura Garcia Liebana
` (5 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Laura Garcia Liebana @ 2016-02-27 23:43 UTC (permalink / raw)
To: outreachy-kernel
Comparison to NULL should be avoided in conditions. Chackpatch detected
these issues.
Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
---
drivers/staging/octeon/ethernet-mdio.c | 2 +-
drivers/staging/octeon/ethernet-mem.c | 4 ++--
drivers/staging/octeon/ethernet-rx.c | 6 +++---
drivers/staging/octeon/ethernet-tx.c | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/octeon/ethernet-mdio.c b/drivers/staging/octeon/ethernet-mdio.c
index 0ac11b1..e13a4ab 100644
--- a/drivers/staging/octeon/ethernet-mdio.c
+++ b/drivers/staging/octeon/ethernet-mdio.c
@@ -196,7 +196,7 @@ int cvm_oct_phy_setup_device(struct net_device *dev)
priv->phydev = of_phy_connect(dev, phy_node, cvm_oct_adjust_link, 0,
PHY_INTERFACE_MODE_GMII);
- if (priv->phydev == NULL)
+ if (!priv->phydev)
return -ENODEV;
priv->last_link = 0;
diff --git a/drivers/staging/octeon/ethernet-mem.c b/drivers/staging/octeon/ethernet-mem.c
index 5a5cdb3..d6172e4 100644
--- a/drivers/staging/octeon/ethernet-mem.c
+++ b/drivers/staging/octeon/ethernet-mem.c
@@ -34,7 +34,7 @@ static int cvm_oct_fill_hw_skbuff(int pool, int size, int elements)
while (freed) {
struct sk_buff *skb = dev_alloc_skb(size + 256);
- if (unlikely(skb == NULL))
+ if (unlikely(!skb))
break;
skb_reserve(skb, 256 - (((unsigned long)skb->data) & 0x7f));
*(struct sk_buff **)(skb->data - sizeof(void *)) = skb;
@@ -98,7 +98,7 @@ static int cvm_oct_fill_hw_memory(int pool, int size, int elements)
* just before the block.
*/
memory = kmalloc(size + 256, GFP_ATOMIC);
- if (unlikely(memory == NULL)) {
+ if (unlikely(!memory)) {
pr_warn("Unable to allocate %u bytes for FPA pool %d\n",
elements * size, pool);
break;
diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
index c35f4ef..ee6c5da 100644
--- a/drivers/staging/octeon/ethernet-rx.c
+++ b/drivers/staging/octeon/ethernet-rx.c
@@ -210,7 +210,7 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
prefetch(work);
did_work_request = 0;
- if (work == NULL) {
+ if (!work) {
if (OCTEON_IS_MODEL(OCTEON_CN68XX)) {
cvmx_write_csr(CVMX_SSO_WQ_IQ_DIS,
1ull << pow_receive_group);
@@ -417,7 +417,7 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
}
cvm_oct_rx_refill_pool(0);
- if (rx_count < budget && napi != NULL) {
+ if (rx_count < budget && napi) {
/* No more work */
napi_complete(napi);
enable_irq(OCTEON_IRQ_WORKQ0 + pow_receive_group);
@@ -450,7 +450,7 @@ void cvm_oct_rx_initialize(void)
}
}
- if (NULL == dev_for_napi)
+ if (!dev_for_napi)
panic("No net_devices were allocated.");
netif_napi_add(dev_for_napi, &cvm_oct_napi, cvm_oct_napi_poll,
diff --git a/drivers/staging/octeon/ethernet-tx.c b/drivers/staging/octeon/ethernet-tx.c
index 82e60ae..f1f693b 100644
--- a/drivers/staging/octeon/ethernet-tx.c
+++ b/drivers/staging/octeon/ethernet-tx.c
@@ -561,7 +561,7 @@ int cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev)
/* Get a packet buffer */
packet_buffer = cvmx_fpa_alloc(CVMX_FPA_PACKET_POOL);
- if (unlikely(packet_buffer == NULL)) {
+ if (unlikely(!packet_buffer)) {
printk_ratelimited("%s: Failed to allocate a packet buffer\n",
dev->name);
cvmx_fpa_free(work, CVMX_FPA_WQE_POOL, 1);
--
2.7.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 05/10] staging: octeon: Fix block comments
2016-02-27 23:41 [PATCH 00/10] staging: octeon: Fix several checkpatch issues Laura Garcia Liebana
` (3 preceding siblings ...)
2016-02-27 23:43 ` [PATCH 04/10] staging: octeon: Remove comparison to NULL Laura Garcia Liebana
@ 2016-02-27 23:43 ` Laura Garcia Liebana
2016-02-27 23:44 ` [PATCH 06/10] staging: octeon: Remove blank lines after open brace Laura Garcia Liebana
` (4 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Laura Garcia Liebana @ 2016-02-27 23:43 UTC (permalink / raw)
To: outreachy-kernel
Remove commented source code. Checkpatch detected these issues.
Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
---
drivers/staging/octeon/ethernet-rx.c | 20 +++++---------------
drivers/staging/octeon/ethernet-tx.c | 33 ++++++++-------------------------
2 files changed, 13 insertions(+), 40 deletions(-)
diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
index ee6c5da..a7340cf 100644
--- a/drivers/staging/octeon/ethernet-rx.c
+++ b/drivers/staging/octeon/ethernet-rx.c
@@ -114,17 +114,11 @@ static inline int cvm_oct_check_rcv_error(cvmx_wqe_t *work)
}
if (*ptr == 0xd5) {
- /*
- printk_ratelimited("Port %d received 0xd5 preamble\n",
- port);
- */
+ /* Port received 0xd5 preamble */
work->packet_ptr.s.addr += i + 1;
work->word1.len -= i + 5;
} else if ((*ptr & 0xf) == 0xd) {
- /*
- printk_ratelimited("Port %d received 0x?d preamble\n",
- port);
- */
+ /* Port received 0xd preamble */
work->packet_ptr.s.addr += i;
work->word1.len -= i + 4;
for (i = 0; i < work->word1.len; i++) {
@@ -136,9 +130,6 @@ static inline int cvm_oct_check_rcv_error(cvmx_wqe_t *work)
} else {
printk_ratelimited("Port %d unknown preamble, packet dropped\n",
port);
- /*
- cvmx_helper_dump_packet(work);
- */
cvm_oct_free_work(work);
return 1;
}
@@ -368,11 +359,10 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
}
netif_receive_skb(skb);
} else {
- /* Drop any packet received for a device that isn't up */
/*
- printk_ratelimited("%s: Device not up, packet dropped\n",
- dev->name);
- */
+ * Drop any packet received for a device that
+ * isn't up.
+ */
priv->stats.rx_dropped++;
dev_kfree_skb_irq(skb);
}
diff --git a/drivers/staging/octeon/ethernet-tx.c b/drivers/staging/octeon/ethernet-tx.c
index f1f693b..b093d2e 100644
--- a/drivers/staging/octeon/ethernet-tx.c
+++ b/drivers/staging/octeon/ethernet-tx.c
@@ -310,55 +310,38 @@ int cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev)
#if REUSE_SKBUFFS_WITHOUT_FREE
fpa_head = skb->head + 256 - ((unsigned long)skb->head & 0x7f);
if (unlikely(skb->data < fpa_head)) {
- /*
- * printk("TX buffer beginning can't meet FPA
- * alignment constraints\n");
- */
+ /* TX buffer beginning can't meet FPA alignment constraints */
goto dont_put_skbuff_in_hw;
}
if (unlikely
((skb_end_pointer(skb) - fpa_head) < CVMX_FPA_PACKET_POOL_SIZE)) {
- /*
- printk("TX buffer isn't large enough for the FPA\n");
- */
+ /* TX buffer isn't large enough for the FPA */
goto dont_put_skbuff_in_hw;
}
if (unlikely(skb_shared(skb))) {
- /*
- printk("TX buffer sharing data with someone else\n");
- */
+ /* TX buffer sharing data with someone else */
goto dont_put_skbuff_in_hw;
}
if (unlikely(skb_cloned(skb))) {
- /*
- printk("TX buffer has been cloned\n");
- */
+ /* TX buffer has been cloned */
goto dont_put_skbuff_in_hw;
}
if (unlikely(skb_header_cloned(skb))) {
- /*
- printk("TX buffer header has been cloned\n");
- */
+ /* TX buffer header has been cloned */
goto dont_put_skbuff_in_hw;
}
if (unlikely(skb->destructor)) {
- /*
- printk("TX buffer has a destructor\n");
- */
+ /* TX buffer has a destructor */
goto dont_put_skbuff_in_hw;
}
if (unlikely(skb_shinfo(skb)->nr_frags)) {
- /*
- printk("TX buffer has fragments\n");
- */
+ /* TX buffer has fragments */
goto dont_put_skbuff_in_hw;
}
if (unlikely
(skb->truesize !=
sizeof(*skb) + skb_end_offset(skb))) {
- /*
- printk("TX buffer truesize has been changed\n");
- */
+ /* TX buffer truesize has been changed */
goto dont_put_skbuff_in_hw;
}
--
2.7.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 06/10] staging: octeon: Remove blank lines after open brace
2016-02-27 23:41 [PATCH 00/10] staging: octeon: Fix several checkpatch issues Laura Garcia Liebana
` (4 preceding siblings ...)
2016-02-27 23:43 ` [PATCH 05/10] staging: octeon: Fix block comments Laura Garcia Liebana
@ 2016-02-27 23:44 ` Laura Garcia Liebana
2016-02-27 23:45 ` [PATCH 07/10] staging: octeon: Fix lines over 80 characters Laura Garcia Liebana
` (3 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Laura Garcia Liebana @ 2016-02-27 23:44 UTC (permalink / raw)
To: outreachy-kernel
Blank lines are not necessary after an open brace. Checkpatch detected
these issues.
Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
---
drivers/staging/octeon/ethernet-rx.c | 1 -
drivers/staging/octeon/ethernet-spi.c | 2 --
drivers/staging/octeon/ethernet-tx.c | 1 -
3 files changed, 4 deletions(-)
diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
index a7340cf..31522c2 100644
--- a/drivers/staging/octeon/ethernet-rx.c
+++ b/drivers/staging/octeon/ethernet-rx.c
@@ -101,7 +101,6 @@ static inline int cvm_oct_check_rcv_error(cvmx_wqe_t *work)
gmxx_rxx_frm_ctl.u64 =
cvmx_read_csr(CVMX_GMXX_RXX_FRM_CTL(index, interface));
if (gmxx_rxx_frm_ctl.s.pre_chk == 0) {
-
u8 *ptr =
cvmx_phys_to_ptr(work->packet_ptr.s.addr);
int i = 0;
diff --git a/drivers/staging/octeon/ethernet-spi.c b/drivers/staging/octeon/ethernet-spi.c
index 2ae1944..063dcd0 100644
--- a/drivers/staging/octeon/ethernet-spi.c
+++ b/drivers/staging/octeon/ethernet-spi.c
@@ -167,9 +167,7 @@ static void cvm_oct_spi_poll(struct net_device *dev)
int interface;
for (interface = 0; interface < 2; interface++) {
-
if ((priv->port == interface * 16) && need_retrain[interface]) {
-
if (cvmx_spi_restart_interface
(interface, CVMX_SPI_MODE_DUPLEX, 10) == 0) {
need_retrain[interface] = 0;
diff --git a/drivers/staging/octeon/ethernet-tx.c b/drivers/staging/octeon/ethernet-tx.c
index b093d2e..024263d4 100644
--- a/drivers/staging/octeon/ethernet-tx.c
+++ b/drivers/staging/octeon/ethernet-tx.c
@@ -428,7 +428,6 @@ dont_put_skbuff_in_hw:
/* Drop this packet if we have too many already queued to the HW */
if (unlikely(skb_queue_len(&priv->tx_free_list[qos]) >=
MAX_OUT_QUEUE_DEPTH)) {
-
if (dev->tx_queue_len != 0) {
/* Drop the lock when notifying the core. */
spin_unlock_irqrestore(&priv->tx_free_list[qos].lock,
--
2.7.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 07/10] staging: octeon: Fix lines over 80 characters
2016-02-27 23:41 [PATCH 00/10] staging: octeon: Fix several checkpatch issues Laura Garcia Liebana
` (5 preceding siblings ...)
2016-02-27 23:44 ` [PATCH 06/10] staging: octeon: Remove blank lines after open brace Laura Garcia Liebana
@ 2016-02-27 23:45 ` Laura Garcia Liebana
2016-02-27 23:45 ` [PATCH 08/10] staging: octeon: Use type s32 instead of int32_t Laura Garcia Liebana
` (2 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Laura Garcia Liebana @ 2016-02-27 23:45 UTC (permalink / raw)
To: outreachy-kernel
The lines should be adjusted to 80 characters. Checkpatch detected these
issues.
Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
---
drivers/staging/octeon/ethernet-rx.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
index 31522c2..a10fe3a 100644
--- a/drivers/staging/octeon/ethernet-rx.c
+++ b/drivers/staging/octeon/ethernet-rx.c
@@ -216,7 +216,8 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
}
break;
}
- pskb = (struct sk_buff **)(cvm_oct_get_buffer_ptr(work->packet_ptr) -
+ pskb = (struct sk_buff **)
+ (cvm_oct_get_buffer_ptr(work->packet_ptr) -
sizeof(void *));
prefetch(pskb);
@@ -298,7 +299,9 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
while (segments--) {
union cvmx_buf_ptr next_ptr =
- *(union cvmx_buf_ptr *)cvmx_phys_to_ptr(segment_ptr.s.addr - 8);
+ *(union cvmx_buf_ptr *)
+ cvmx_phys_to_ptr(
+ segment_ptr.s.addr - 8);
/*
* Octeon Errata PKI-100: The segment size is
@@ -322,7 +325,8 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
segment_size = len;
/* Copy the data into the packet */
memcpy(skb_put(skb, segment_size),
- cvmx_phys_to_ptr(segment_ptr.s.addr),
+ cvmx_phys_to_ptr(
+ segment_ptr.s.addr),
segment_size);
len -= segment_size;
segment_ptr = next_ptr;
--
2.7.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 08/10] staging: octeon: Use type s32 instead of int32_t
2016-02-27 23:41 [PATCH 00/10] staging: octeon: Fix several checkpatch issues Laura Garcia Liebana
` (6 preceding siblings ...)
2016-02-27 23:45 ` [PATCH 07/10] staging: octeon: Fix lines over 80 characters Laura Garcia Liebana
@ 2016-02-27 23:45 ` Laura Garcia Liebana
2016-03-11 18:12 ` [Outreachy kernel] " Greg KH
2016-02-27 23:46 ` [PATCH 09/10] staging: octeon: Remove multiple blank lines Laura Garcia Liebana
2016-02-27 23:47 ` [PATCH 10/10] staging: octeon: Fix braces in condition statement Laura Garcia Liebana
9 siblings, 1 reply; 13+ messages in thread
From: Laura Garcia Liebana @ 2016-02-27 23:45 UTC (permalink / raw)
To: outreachy-kernel
Prefer the use of type s32 instead of int32_t. Checkpatch detected these
issues.
Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
---
drivers/staging/octeon/ethernet-tx.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/octeon/ethernet-tx.c b/drivers/staging/octeon/ethernet-tx.c
index 024263d4..db04388 100644
--- a/drivers/staging/octeon/ethernet-tx.c
+++ b/drivers/staging/octeon/ethernet-tx.c
@@ -58,9 +58,9 @@ static DECLARE_TASKLET(cvm_oct_tx_cleanup_tasklet, cvm_oct_tx_do_cleanup, 0);
/* Maximum number of SKBs to try to free per xmit packet. */
#define MAX_SKB_TO_FREE (MAX_OUT_QUEUE_DEPTH * 2)
-static inline int32_t cvm_oct_adjust_skb_to_free(int32_t skb_to_free, int fau)
+static inline s32 cvm_oct_adjust_skb_to_free(s32 skb_to_free, int fau)
{
- int32_t undo;
+ s32 undo;
undo = skb_to_free > 0 ? MAX_SKB_TO_FREE : skb_to_free +
MAX_SKB_TO_FREE;
@@ -83,7 +83,7 @@ static void cvm_oct_kick_tx_poll_watchdog(void)
static void cvm_oct_free_tx_skbs(struct net_device *dev)
{
- int32_t skb_to_free;
+ s32 skb_to_free;
int qos, queues_per_port;
int total_freed = 0;
int total_remaining = 0;
@@ -150,8 +150,8 @@ int cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev)
enum {QUEUE_CORE, QUEUE_HW, QUEUE_DROP} queue_type;
struct octeon_ethernet *priv = netdev_priv(dev);
struct sk_buff *to_free_list;
- int32_t skb_to_free;
- int32_t buffers_to_free;
+ s32 skb_to_free;
+ s32 buffers_to_free;
u32 total_to_clean;
unsigned long flags;
#if REUSE_SKBUFFS_WITHOUT_FREE
--
2.7.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [Outreachy kernel] [PATCH 08/10] staging: octeon: Use type s32 instead of int32_t
2016-02-27 23:45 ` [PATCH 08/10] staging: octeon: Use type s32 instead of int32_t Laura Garcia Liebana
@ 2016-03-11 18:12 ` Greg KH
0 siblings, 0 replies; 13+ messages in thread
From: Greg KH @ 2016-03-11 18:12 UTC (permalink / raw)
To: Laura Garcia Liebana; +Cc: outreachy-kernel
On Sun, Feb 28, 2016 at 12:45:53AM +0100, Laura Garcia Liebana wrote:
> Prefer the use of type s32 instead of int32_t. Checkpatch detected these
> issues.
>
> Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
> ---
> drivers/staging/octeon/ethernet-tx.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/octeon/ethernet-tx.c b/drivers/staging/octeon/ethernet-tx.c
> index 024263d4..db04388 100644
> --- a/drivers/staging/octeon/ethernet-tx.c
> +++ b/drivers/staging/octeon/ethernet-tx.c
> @@ -58,9 +58,9 @@ static DECLARE_TASKLET(cvm_oct_tx_cleanup_tasklet, cvm_oct_tx_do_cleanup, 0);
> /* Maximum number of SKBs to try to free per xmit packet. */
> #define MAX_SKB_TO_FREE (MAX_OUT_QUEUE_DEPTH * 2)
>
> -static inline int32_t cvm_oct_adjust_skb_to_free(int32_t skb_to_free, int fau)
> +static inline s32 cvm_oct_adjust_skb_to_free(s32 skb_to_free, int fau)
These really can all be switched to 'int', right?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 09/10] staging: octeon: Remove multiple blank lines
2016-02-27 23:41 [PATCH 00/10] staging: octeon: Fix several checkpatch issues Laura Garcia Liebana
` (7 preceding siblings ...)
2016-02-27 23:45 ` [PATCH 08/10] staging: octeon: Use type s32 instead of int32_t Laura Garcia Liebana
@ 2016-02-27 23:46 ` Laura Garcia Liebana
2016-02-27 23:47 ` [PATCH 10/10] staging: octeon: Fix braces in condition statement Laura Garcia Liebana
9 siblings, 0 replies; 13+ messages in thread
From: Laura Garcia Liebana @ 2016-02-27 23:46 UTC (permalink / raw)
To: outreachy-kernel
Avoid the use of multiple blank lines. Checkpatch detected these issues.
Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
---
drivers/staging/octeon/ethernet-tx.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/staging/octeon/ethernet-tx.c b/drivers/staging/octeon/ethernet-tx.c
index db04388..313c845 100644
--- a/drivers/staging/octeon/ethernet-tx.c
+++ b/drivers/staging/octeon/ethernet-tx.c
@@ -99,8 +99,6 @@ static void cvm_oct_free_tx_skbs(struct net_device *dev)
MAX_SKB_TO_FREE);
skb_to_free = cvm_oct_adjust_skb_to_free(skb_to_free,
priv->fau + qos * 4);
-
-
total_freed += skb_to_free;
if (skb_to_free > 0) {
struct sk_buff *to_free_list = NULL;
--
2.7.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 10/10] staging: octeon: Fix braces in condition statement
2016-02-27 23:41 [PATCH 00/10] staging: octeon: Fix several checkpatch issues Laura Garcia Liebana
` (8 preceding siblings ...)
2016-02-27 23:46 ` [PATCH 09/10] staging: octeon: Remove multiple blank lines Laura Garcia Liebana
@ 2016-02-27 23:47 ` Laura Garcia Liebana
9 siblings, 0 replies; 13+ messages in thread
From: Laura Garcia Liebana @ 2016-02-27 23:47 UTC (permalink / raw)
To: outreachy-kernel
Braces should be used on all arms of the if statement. Checkpatch
detected this issue.
Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
---
drivers/staging/octeon/ethernet-tx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/octeon/ethernet-tx.c b/drivers/staging/octeon/ethernet-tx.c
index 313c845..b106b0c 100644
--- a/drivers/staging/octeon/ethernet-tx.c
+++ b/drivers/staging/octeon/ethernet-tx.c
@@ -174,8 +174,9 @@ int cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev)
qos = 0;
else if (qos >= cvmx_pko_get_num_queues(priv->port))
qos = 0;
- } else
+ } else {
qos = 0;
+ }
if (USE_ASYNC_IOBDMA) {
/* Save scratch in case userspace is using it */
--
2.7.0
^ permalink raw reply related [flat|nested] 13+ messages in thread