Linux kernel staging patches
 help / color / mirror / Atom feed
* [PATCH] staging: octeon: ethernet: remove redundant parentheses in conditionals
@ 2026-07-02 20:35 Abhinav Srivastava
  2026-07-07  9:25 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Abhinav Srivastava @ 2026-07-02 20:35 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, Abhinav Srivastava

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

Signed-off-by: Abhinav Srivastava <atg271@gmail.com>
---
 drivers/staging/octeon/ethernet.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
index f3fa221f4..e28625b47 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -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;
-- 
2.50.1 (Apple Git-155)


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: octeon: ethernet: remove redundant parentheses in conditionals
  2026-07-02 20:35 [PATCH] staging: octeon: ethernet: remove redundant parentheses in conditionals Abhinav Srivastava
@ 2026-07-07  9:25 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2026-07-07  9:25 UTC (permalink / raw)
  To: Abhinav Srivastava; +Cc: linux-staging, linux-kernel

On Thu, Jul 02, 2026 at 01:35:57PM -0700, Abhinav Srivastava wrote:
> Remove extra parentheses in 3 multiline if conditions and align
> continuation lines under opening parenthesis. No functional change
> intended.
> 
> Signed-off-by: Abhinav Srivastava <atg271@gmail.com>
> ---
>  drivers/staging/octeon/ethernet.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
> index f3fa221f4..e28625b47 100644
> --- a/drivers/staging/octeon/ethernet.c
> +++ b/drivers/staging/octeon/ethernet.c
> @@ -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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-07  9:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-02 20:35 [PATCH] staging: octeon: ethernet: remove redundant parentheses in conditionals Abhinav Srivastava
2026-07-07  9:25 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox