[PATCH] staging: octeon: remove unnecessary parentheses
From: Tianbo Fu
Date: Fri Oct 02 2026 - 09:16:58 EST
checkpatch.pl reports multiple CHECKs for unnecessary parentheses
around single conditions. Remove them to improve readability.
No functional change.
Signed-off-by: Tianbo Fu <3064575448@xxxxxx>
---
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(-)
diff --git a/drivers/staging/octeon/ethernet-rgmii.c b/drivers/staging/octeon/ethernet-rgmii.c
index 0c4fac31540a..15d2c84925ba 100644
--- a/drivers/staging/octeon/ethernet-rgmii.c
+++ b/drivers/staging/octeon/ethernet-rgmii.c
@@ -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);
}
diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
index 5be43bbf6a1d..e3c773e468b5 100644
--- a/drivers/staging/octeon/ethernet-rx.c
+++ b/drivers/staging/octeon/ethernet-rx.c
@@ -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];
diff --git a/drivers/staging/octeon/ethernet-tx.c b/drivers/staging/octeon/ethernet-tx.c
index cc20c1e6791f..f13069d6bd2c 100644
--- a/drivers/staging/octeon/ethernet-tx.c
+++ b/drivers/staging/octeon/ethernet-tx.c
@@ -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;
}
diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
index 42ec4b8324a8..9db1fcb894ea 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -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;
--
2.55.0