All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: octeon: Remove unnecessary parentheses
@ 2017-09-14 16:51 Meghana Madhyastha
  0 siblings, 0 replies; 12+ messages in thread
From: Meghana Madhyastha @ 2017-09-14 16:51 UTC (permalink / raw)
  To: outreachy-kernel, gregkh

Removes unnecessary parentheses inside the conditional
statement.

Found by checkpath.pl

Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com>
---
 drivers/staging/octeon/ethernet-spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/octeon/ethernet-spi.c b/drivers/staging/octeon/ethernet-spi.c
index 063dcd0..8c6bb93 100644
--- a/drivers/staging/octeon/ethernet-spi.c
+++ b/drivers/staging/octeon/ethernet-spi.c
@@ -213,7 +213,7 @@ int cvm_oct_spi_init(struct net_device *dev)
 	}
 	number_spi_ports++;
 
-	if ((priv->port == 0) || (priv->port == 16)) {
+	if (priv->port == 0 || priv->port == 16) {
 		cvm_oct_spi_enable_error_reporting(INTERFACE(priv->port));
 		priv->poll = cvm_oct_spi_poll;
 	}
-- 
2.7.4



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

* [PATCH] staging: octeon: Remove unnecessary parentheses
@ 2023-08-13  0:53 Cyrus Ramavarapu
  2023-08-13  6:28 ` Greg KH
  0 siblings, 1 reply; 12+ messages in thread
From: Cyrus Ramavarapu @ 2023-08-13  0:53 UTC (permalink / raw)
  To: gregkh, linux-staging, linux-kernel; +Cc: Cyrus Ramavarapu

Remove unnecessary parentheses found by checkpatch.

Signed-off-by: Cyrus Ramavarapu <cyrus.ramavarapu@gmail.com>
---
 drivers/staging/octeon/ethernet-rgmii.c | 2 +-
 drivers/staging/octeon/ethernet-rx.c    | 5 ++---
 drivers/staging/octeon/ethernet-tx.c    | 8 ++++----
 drivers/staging/octeon/ethernet.c       | 6 +++---
 4 files changed, 10 insertions(+), 11 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 965330eec80a..db359a1e0b08 100644
--- a/drivers/staging/octeon/ethernet-rx.c
+++ b/drivers/staging/octeon/ethernet-rx.c
@@ -69,7 +69,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
@@ -324,8 +324,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) &&
-			   cvm_oct_device[port])) {
+		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 bbf33b88bb7c..0954509ea42c 100644
--- a/drivers/staging/octeon/ethernet-tx.c
+++ b/drivers/staging/octeon/ethernet-tx.c
@@ -153,8 +153,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;
@@ -224,7 +224,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,7 +360,7 @@ 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)) &&
+	if (skb->protocol == htons(ETH_P_IP) &&
 	    (ip_hdr(skb)->version == 4) &&
 	    (ip_hdr(skb)->ihl == 5) &&
 	    ((ip_hdr(skb)->frag_off == 0) ||
diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
index 9eee28f2940c..d025ce51e755 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -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.41.0


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

* Re: [PATCH] staging: octeon: Remove unnecessary parentheses
  2023-08-13  0:53 [PATCH] staging: octeon: Remove " Cyrus Ramavarapu
@ 2023-08-13  6:28 ` Greg KH
  0 siblings, 0 replies; 12+ messages in thread
From: Greg KH @ 2023-08-13  6:28 UTC (permalink / raw)
  To: Cyrus Ramavarapu; +Cc: linux-staging, linux-kernel

On Sat, Aug 12, 2023 at 08:53:26PM -0400, Cyrus Ramavarapu wrote:
> Remove unnecessary parentheses found by checkpatch.

Please no, don't do this, see the email archives of this list for why I
don't like this type of change (it forces you do have to remember rules
when looking at the code in the future.)

I wish checkpatch would not report this type of issue anymore...

thanks,

greg k-h

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

* [PATCH] staging: octeon: remove unnecessary parentheses
@ 2023-10-29 16:01 Dorine Tipo
  2023-10-29 16:30 ` Julia Lawall
  0 siblings, 1 reply; 12+ messages in thread
From: Dorine Tipo @ 2023-10-29 16:01 UTC (permalink / raw)
  To: outreachy, gregkh, julia.lawall; +Cc: 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.

Changes made:
- Removed unnecessary parentheses around 'interface < 2'.

The parentheses around interface < 2 are not necessary because
the < operator has a higher precedence than the && operator.
In this context, removing these parentheses doesn't change the order of
evaluation or the logic of the code and improves readability

Signed-off-by: Dorine Tipo <dorine.a.tipo@gmail.com>
---
 drivers/staging/octeon/ethernet.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
index 8e1f4b987a25..349308edbc9e 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -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


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

* [PATCH] staging: octeon: remove unnecessary parentheses
@ 2023-10-29 16:24 Dorine Tipo
  2023-10-29 16:53 ` Julia Lawall
  0 siblings, 1 reply; 12+ messages in thread
From: Dorine Tipo @ 2023-10-29 16:24 UTC (permalink / raw)
  To: outreachy, gregkh, julia.lawall; +Cc: 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.

- Remove unnecessary parentheses around 'interface < 2'.

Signed-off-by: Dorine Tipo <dorine.a.tipo@gmail.com>

---
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(-)

diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
index 8e1f4b987a25..349308edbc9e 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -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


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

* Re: [PATCH] staging: octeon: remove unnecessary parentheses
  2023-10-29 16:01 Dorine Tipo
@ 2023-10-29 16:30 ` Julia Lawall
  0 siblings, 0 replies; 12+ messages in thread
From: Julia Lawall @ 2023-10-29 16:30 UTC (permalink / raw)
  To: Dorine Tipo; +Cc: outreachy, gregkh



On Sun, 29 Oct 2023, Dorine Tipo wrote:

> 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.

This revision information is supposed to be underneath the ---.  It will
be meaningless to anyone who looks at this patch in the future, because
they won't be seeing the old versions.

Since this is not the first version of this patch, there should be v2 v3
or v4 etc in the subject line after the word PATCH.  Please see the first
patch tutorial in the section Revising your patches

>
> Changes made:

Drop this.

> - Removed unnecessary parentheses around 'interface < 2'.

Removed -> Remove

> The parentheses around interface < 2 are not necessary because
> the < operator has a higher precedence than the && operator.
> In this context, removing these parentheses doesn't change the order of
> evaluation or the logic of the code and improves readability

This is a fine explanation, although a bit verbose.  Try to express the
whole thing in 1 or 2 sentences.

julia

> Signed-off-by: Dorine Tipo <dorine.a.tipo@gmail.com>
> ---
>  drivers/staging/octeon/ethernet.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
> index 8e1f4b987a25..349308edbc9e 100644
> --- a/drivers/staging/octeon/ethernet.c
> +++ b/drivers/staging/octeon/ethernet.c
> @@ -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
>
>

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

* [PATCH] staging: octeon: remove unnecessary parentheses
@ 2023-10-29 16:35 Dorine Tipo
  2023-10-29 17:15 ` Julia Lawall
  0 siblings, 1 reply; 12+ messages in thread
From: Dorine Tipo @ 2023-10-29 16:35 UTC (permalink / raw)
  To: outreachy, gregkh, julia.lawall; +Cc: Dorine Tipo

- 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.

Signed-off-by: Dorine Tipo <dorine.a.tipo@gmail.com>

---
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.

 drivers/staging/octeon/ethernet.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
index 8e1f4b987a25..349308edbc9e 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -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


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

* Re: [PATCH] staging: octeon: remove unnecessary parentheses
  2023-10-29 16:24 Dorine Tipo
@ 2023-10-29 16:53 ` Julia Lawall
  0 siblings, 0 replies; 12+ messages in thread
From: Julia Lawall @ 2023-10-29 16:53 UTC (permalink / raw)
  To: Dorine Tipo; +Cc: outreachy, gregkh

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.

On Sun, 29 Oct 2023, Dorine Tipo wrote:

> 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'.
>
> Signed-off-by: Dorine Tipo <dorine.a.tipo@gmail.com>
>
> ---
> 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

>  drivers/staging/octeon/ethernet.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
> index 8e1f4b987a25..349308edbc9e 100644
> --- a/drivers/staging/octeon/ethernet.c
> +++ b/drivers/staging/octeon/ethernet.c
> @@ -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
>
>

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

* Re: [PATCH] staging: octeon: remove unnecessary parentheses
  2023-10-29 16:35 Dorine Tipo
@ 2023-10-29 17:15 ` Julia Lawall
  0 siblings, 0 replies; 12+ messages in thread
From: Julia Lawall @ 2023-10-29 17:15 UTC (permalink / raw)
  To: Dorine Tipo; +Cc: outreachy, gregkh



On Sun, 29 Oct 2023, Dorine Tipo wrote:

> - 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.
>
> Signed-off-by: Dorine Tipo <dorine.a.tipo@gmail.com>
>
> ---
> 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.

There is still the case that this patch is a revision of a previous one,
but there is no [PATCH v2] in the subject line.  Theer have been a lot of
versions of this patch, so I don't know which number this one would be,
but at least if there were a v2, one would know that the v2 one is more
recent than all of the others.

julia

>
>  drivers/staging/octeon/ethernet.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
> index 8e1f4b987a25..349308edbc9e 100644
> --- a/drivers/staging/octeon/ethernet.c
> +++ b/drivers/staging/octeon/ethernet.c
> @@ -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
>
>

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

* Re: [PATCH] staging: octeon: remove unnecessary parentheses
  2026-10-02 20:51 [PATCH] staging: octeon: remove unnecessary parentheses Tianbo Fu
@ 2026-10-02 14:00 ` Greg Kroah-Hartman
  2026-10-13 13:40 ` Greg Kroah-Hartman
  1 sibling, 0 replies; 12+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-02 14:00 UTC (permalink / raw)
  To: Tianbo Fu; +Cc: linux-staging, linux-kernel

On Sat, Oct 03, 2026 at 04:51:29AM +0800, Tianbo Fu wrote:
> 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.

Take a look at where I have rejected previous such patches in the past
in the archives (like just yesterday...)

https://lore.kernel.org/linux-staging/2026100127-fifty-wrought-2d30@gregkh

thanks,

greg k-h

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

* [PATCH] staging: octeon: remove unnecessary parentheses
@ 2026-10-02 20:51 Tianbo Fu
  2026-10-02 14:00 ` Greg Kroah-Hartman
  2026-10-13 13:40 ` Greg Kroah-Hartman
  0 siblings, 2 replies; 12+ messages in thread
From: Tianbo Fu @ 2026-10-02 20:51 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-staging, linux-kernel

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


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

* Re: [PATCH] staging: octeon: remove unnecessary parentheses
  2026-10-02 20:51 [PATCH] staging: octeon: remove unnecessary parentheses Tianbo Fu
  2026-10-02 14:00 ` Greg Kroah-Hartman
@ 2026-10-13 13:40 ` Greg Kroah-Hartman
  1 sibling, 0 replies; 12+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-13 13:40 UTC (permalink / raw)
  To: Tianbo Fu; +Cc: linux-staging, linux-kernel

On Sat, Oct 03, 2026 at 04:51:29AM +0800, Tianbo Fu wrote:
> 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.

Please see the archives for why I keep rejecting this type of change.

thanks,

greg k-h

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

end of thread, other threads:[~2026-10-13 13:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-02 20:51 [PATCH] staging: octeon: remove unnecessary parentheses Tianbo Fu
2026-10-02 14:00 ` Greg Kroah-Hartman
2026-10-13 13:40 ` Greg Kroah-Hartman
  -- strict thread matches above, loose matches on Subject: below --
2023-10-29 16:35 Dorine Tipo
2023-10-29 17:15 ` Julia Lawall
2023-10-29 16:24 Dorine Tipo
2023-10-29 16:53 ` Julia Lawall
2023-10-29 16:01 Dorine Tipo
2023-10-29 16:30 ` Julia Lawall
2023-08-13  0:53 [PATCH] staging: octeon: Remove " Cyrus Ramavarapu
2023-08-13  6:28 ` Greg KH
2017-09-14 16:51 [PATCH] Staging: " Meghana Madhyastha

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.