Skip to contentSkip to conversation

staging: octeon: remove unnecessary parentheses

PATCH In review Tianbo Fu 2 participants 3 messages Oct 2 – Oct 13 Staging

lore
Share & tools
lore

Tianbo Fu

author
#0 lore raw

PATCH 1/1 staging: octeon: remove unnecessary parentheses

checkpatch.pl reports multiple CHECKs for unnecessary parentheses around single conditions. Remove them to improve readability.

No functional change.

---
Hi Greg,

I removed some unnecessary parentheses and compiled this on my x86_64 computer successfully. Please let me know if anything needs fixing.

Thanks,
Tianbo Fu

---
 drivers/staging/octeon/ethernet-rgmii.c |  2 +-
 drivers/staging/octeon/ethernet-rx.c    |  4 ++--
 drivers/staging/octeon/ethernet-tx.c    | 20 ++++++++++----------
 drivers/staging/octeon/ethernet.c       |  6 +++---
 4 files changed, 16 insertions(+), 16 deletions(-)
drivers/staging/octeon/ethernet-rgmii.c +1 -1
index 0c4fac31540a..15d2c84925ba 100644
@@ -148,7 +148,7 @@ int cvm_oct_rgmii_open(struct net_device *dev)
 		 */
 		if ((priv->imode == CVMX_HELPER_INTERFACE_MODE_GMII &&
 		     priv->port  == 0) ||
-		    (priv->imode == CVMX_HELPER_INTERFACE_MODE_RGMII)) {
+		    priv->imode == CVMX_HELPER_INTERFACE_MODE_RGMII) {
 			priv->poll = cvm_oct_check_preamble_errors;
 			cvm_oct_check_preamble_errors(dev);
 		}
drivers/staging/octeon/ethernet-rx.c +2 -2
index 5be43bbf6a1d..e3c773e468b5 100644
@@ -66,7 +66,7 @@ static inline int cvm_oct_check_rcv_error(struct cvmx_wqe *work)
 	else
 		port = work->word1.cn38xx.ipprt;
 
-	if ((work->word2.snoip.err_code == 10) && (work->word1.len <= 64))
+	if (work->word2.snoip.err_code == 10 && work->word1.len <= 64)
 		/*
 		 * Ignore length errors on min size packets. Some
 		 * equipment incorrectly pads packets to 64+4FCS
@@ -321,7 +321,7 @@ static int cvm_oct_poll(struct oct_rx_group *rx_group, int budget)
 			}
 			packet_not_copied = 0;
 		}
-		if (likely((port < TOTAL_NUMBER_OF_PORTS) &&
+		if (likely(port < TOTAL_NUMBER_OF_PORTS &&
 			   cvm_oct_device[port])) {
 			struct net_device *dev = cvm_oct_device[port];
 
drivers/staging/octeon/ethernet-tx.c +10 -10
index cc20c1e6791f..f13069d6bd2c 100644
@@ -154,8 +154,8 @@ netdev_tx_t cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev)
 	 * completely remove "qos" in the event neither interface
 	 * supports multiple queues per port.
 	 */
-	if ((CVMX_PKO_QUEUES_PER_PORT_INTERFACE0 > 1) ||
-	    (CVMX_PKO_QUEUES_PER_PORT_INTERFACE1 > 1)) {
+	if (CVMX_PKO_QUEUES_PER_PORT_INTERFACE0 > 1 ||
+	    CVMX_PKO_QUEUES_PER_PORT_INTERFACE1 > 1) {
 		qos = GET_SKBUFF_QOS(skb);
 		if (qos <= 0)
 			qos = 0;
@@ -225,7 +225,7 @@ netdev_tx_t cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev)
 	 * no room to add the padding.  The kernel should always give
 	 * us at least a cache line
 	 */
-	if ((skb->len < 64) && OCTEON_IS_MODEL(OCTEON_CN3XXX)) {
+	if (skb->len < 64 && OCTEON_IS_MODEL(OCTEON_CN3XXX)) {
 		union cvmx_gmxx_prtx_cfg gmx_prt_cfg;
 		int interface = INTERFACE(priv->port);
 		int index = INDEX(priv->port);
@@ -360,13 +360,13 @@ netdev_tx_t cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev)
 dont_put_skbuff_in_hw:
 
 	/* Check if we can use the hardware checksumming */
-	if ((skb->protocol == htons(ETH_P_IP)) &&
-	    (ip_hdr(skb)->version == 4) &&
-	    (ip_hdr(skb)->ihl == 5) &&
-	    ((ip_hdr(skb)->frag_off == 0) ||
-	     (ip_hdr(skb)->frag_off == htons(1 << 14))) &&
-	    ((ip_hdr(skb)->protocol == IPPROTO_TCP) ||
-	     (ip_hdr(skb)->protocol == IPPROTO_UDP))) {
+	if (skb->protocol == htons(ETH_P_IP) &&
+	    ip_hdr(skb)->version == 4 &&
+	    ip_hdr(skb)->ihl == 5 &&
+	    (ip_hdr(skb)->frag_off == 0 ||
+	     ip_hdr(skb)->frag_off == htons(1 << 14)) &&
+	    (ip_hdr(skb)->protocol == IPPROTO_TCP ||
+	     ip_hdr(skb)->protocol == IPPROTO_UDP)) {
 		/* Use hardware checksum calc */
 		pko_command.s.ipoffp1 = skb_network_offset(skb) + 1;
 	}
drivers/staging/octeon/ethernet.c +3 -3
index 42ec4b8324a8..9db1fcb894ea 100644
@@ -262,7 +262,7 @@ static int cvm_oct_common_change_mtu(struct net_device *dev, int new_mtu)
 
 	dev->mtu = new_mtu;
 
-	if ((interface < 2) &&
+	if (interface < 2 &&
 	    (cvmx_helper_interface_get_mode(interface) !=
 		CVMX_HELPER_INTERFACE_MODE_SPI)) {
 		int index = INDEX(priv->port);
@@ -308,7 +308,7 @@ static void cvm_oct_common_set_multicast_list(struct net_device *dev)
 	struct octeon_ethernet *priv = netdev_priv(dev);
 	int interface = INTERFACE(priv->port);
 
-	if ((interface < 2) &&
+	if (interface < 2 &&
 	    (cvmx_helper_interface_get_mode(interface) !=
 		CVMX_HELPER_INTERFACE_MODE_SPI)) {
 		union cvmx_gmxx_rxx_adr_ctl control;
@@ -360,7 +360,7 @@ static int cvm_oct_set_mac_filter(struct net_device *dev)
 	union cvmx_gmxx_prtx_cfg gmx_cfg;
 	int interface = INTERFACE(priv->port);
 
-	if ((interface < 2) &&
+	if (interface < 2 &&
 	    (cvmx_helper_interface_get_mode(interface) !=
 		CVMX_HELPER_INTERFACE_MODE_SPI)) {
 		int i;
Signature · 1 line
2.55.0
#1 lore raw
Quoted 5 lines · Tianbo Fu

checkpatch.pl reports multiple CHECKs for unnecessary parentheses around single conditions. Remove them to improve readability.

No functional change.

Quoted 7 lines

---
Hi Greg,

I removed some unnecessary parentheses and compiled this on my x86_64 computer successfully. Please let me know if anything needs fixing.

Take a look at where I have rejected previous such patches in the past in the archives (like just yesterday...)

https://lore.kernel.org/linux-staging/2026100127-fifty-wrought-2d30@gregkh

thanks,

greg k-h

#2 lore raw
In reply to Tianbo Fu
Quoted 5 lines · Tianbo Fu

checkpatch.pl reports multiple CHECKs for unnecessary parentheses around single conditions. Remove them to improve readability.

No functional change.

Quoted 7 lines

---
Hi Greg,

I removed some unnecessary parentheses and compiled this on my x86_64 computer successfully. Please let me know if anything needs fixing.

Please see the archives for why I keep rejecting this type of change.

thanks,

greg k-h