Skip to contentSkip to conversation

staging: octeon: remove unnecessary parentheses

PATCH In review Dorine Tipo 2 participants 2 messages Oct 29, 2023 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: octeon: remove unnecessary parentheses

This patch addresses the unnecessary issue reported by checkpatch. The subject line has been revised to be more concise and less detailed, as suggested in the patch feedback.

- Remove unnecessary parentheses around 'interface < 2'.

---
Removing the parentheses around interface < 2 improves readability without changing the order of evaluation of the logic because the < operator has a higher precedence than the && operator.

 drivers/staging/octeon/ethernet.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/octeon/ethernet.c +3 -3
index 8e1f4b987a25..349308edbc9e 100644
@@ -248,7 +248,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);
@@ -294,7 +294,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;
@@ -346,7 +346,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.25.1
#1 lore raw

This patch is working on the same code as the previous one, but there is no indication that it is anything other than the first version.

Quoted 4 lines · Dorine Tipo

This patch addresses the unnecessary issue reported by checkpatch. The subject line has been revised to be more concise and less detailed, as suggested in the patch feedback.

Quoted 8 lines

- Remove unnecessary parentheses around 'interface < 2'.

---
Removing the parentheses around interface < 2 improves readability without changing the order of evaluation of the logic because the < operator has a higher precedence than the && operator.

This is quite backwards. Above the line you should provide all of the information that will be useful to people in the future, and thus should be recorded in the git tree.

Below the line, you should indicate what has changed since the previous version. This should contain the entire history of the evolution of the patch, as illustrated in the Revising your patches section of the furst patch tutorial.

julia

Quoted 38 lines
 drivers/staging/octeon/ethernet.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/octeon/ethernet.c +3 -4
index 8e1f4b987a25..349308edbc9e 100644
@@ -248,7 +248,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);
@@ -294,7 +294,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;
@@ -346,7 +346,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.25.1