[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241015044507.1177265-1-atg271@gmail.com>
Date: Mon, 14 Oct 2024 21:45:07 -0700
From: Abhinav Srivastava <atg271@...il.com>
To: gregkh@...uxfoundation.org
Cc: linux-kernel@...r.kernel.org,
Abhinav Srivastava <atg271@...il.com>
Subject: [PATCH] ethernet: Improve formatting of conditional statements
Improve readability of conditional statements in the Octeon ethernet
driver by removing unnecessary parentheses and adjusting line breaks.
This change focuses on three functions:
- cvm_oct_common_change_mtu()
- cvm_oct_common_set_multicast_list()
- cvm_oct_set_mac_filter()
The modifications make the code more consistent with the Linux kernel
coding style guidelines, specifically in regards to the formatting of
multi-line conditional statements. No functional changes are made.
Signed-off-by: Abhinav Srivastava <atg271@...il.com>
---
drivers/staging/octeon/ethernet.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
index a5e99cc78a45..77044b7b40da 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -248,9 +248,8 @@ static int cvm_oct_common_change_mtu(struct net_device *dev, int new_mtu)
dev->mtu = new_mtu;
- if ((interface < 2) &&
- (cvmx_helper_interface_get_mode(interface) !=
- CVMX_HELPER_INTERFACE_MODE_SPI)) {
+ if (interface < 2 && cvmx_helper_interface_get_mode(interface) !=
+ CVMX_HELPER_INTERFACE_MODE_SPI){
int index = INDEX(priv->port);
/* Add ethernet header and FCS, and VLAN if configured. */
int max_packet = new_mtu + mtu_overhead;
@@ -294,9 +293,8 @@ 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) &&
- (cvmx_helper_interface_get_mode(interface) !=
- CVMX_HELPER_INTERFACE_MODE_SPI)) {
+ if (interface < 2 && cvmx_helper_interface_get_mode(interface) !=
+ CVMX_HELPER_INTERFACE_MODE_SPI) {
union cvmx_gmxx_rxx_adr_ctl control;
int index = INDEX(priv->port);
@@ -346,9 +344,8 @@ 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) &&
- (cvmx_helper_interface_get_mode(interface) !=
- CVMX_HELPER_INTERFACE_MODE_SPI)) {
+ if (interface < 2 && cvmx_helper_interface_get_mode(interface) !=
+ CVMX_HELPER_INTERFACE_MODE_SPI) {
int i;
const u8 *ptr = dev->dev_addr;
u64 mac = 0;
--
2.34.1
Powered by blists - more mailing lists