From: Tianbo Fu <3064575448@qq.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH] staging: octeon: remove unnecessary parentheses
Date: Sat, 3 Oct 2026 04:51:29 +0800 [thread overview]
Message-ID: <tencent_41FEF4B2AA27128459C679783AD4D039F207@qq.com> (raw)
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@qq.com>
---
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
next reply other threads:[~2026-10-02 13:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-02 20:51 Tianbo Fu [this message]
2026-10-02 14:00 ` Greg Kroah-Hartman
-- strict thread matches above, loose matches on Subject: below --
2023-08-13 0:53 [PATCH] staging: octeon: Remove " Cyrus Ramavarapu
2023-08-13 6:28 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tencent_41FEF4B2AA27128459C679783AD4D039F207@qq.com \
--to=3064575448@qq.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®