Skip to contentSkip to conversation

staging: octeon: ethernet: remove redundant parentheses in conditionals

PATCH In review Abhinav Srivastava 2 participants 2 messages Jul 2 – Jul 7 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: octeon: ethernet: remove redundant parentheses in conditionals

Remove extra parentheses in 3 multiline if conditions and align continuation lines under opening parenthesis. No functional change intended.

---
 drivers/staging/octeon/ethernet.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/staging/octeon/ethernet.c +9 -9
index f3fa221f4..e28625b47 100644
@@ -247,9 +247,9 @@ 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;
@@ -293,9 +293,9 @@ 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);
 
@@ -345,9 +345,9 @@ 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;
Signature · 1 line
2.50.1 (Apple Git-155)
maintainer
#1 lore raw
Quoted 14 lines · Abhinav Srivastava

Remove extra parentheses in 3 multiline if conditions and align continuation lines under opening parenthesis. No functional change intended.

---
 drivers/staging/octeon/ethernet.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/staging/octeon/ethernet.c +0 -0
index f3fa221f4..e28625b47 100644

drivers/staging/octeon/ethernet.c static int cvm_oct_common_change_mtu(struct net_device *dev, int new_mtu) · line 252

Quoted 9 lines
drivers/staging/octeon/ethernet.c +3 -3
@@ -247,9 +247,9 @@ 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) {

You changed the indentation :(

Also, now we have to remember what the precidence order is, which is a pain. We write code for people first, compilers second, and this code is the same either way for the compiler, so leave it alone to make it easier for people to understand it.

thanks,

greg k-h