* [PATCH] staging: Remove unnecessary parentheses
@ 2023-10-29 18:54 Dorine Tipo
2023-10-30 12:06 ` Bagas Sanjaya
0 siblings, 1 reply; 4+ messages in thread
From: Dorine Tipo @ 2023-10-29 18:54 UTC (permalink / raw)
To: outreachy, gregkh; +Cc: Dorine Tipo
- Remove the unnecessary parentheses around
'priv->imode == CVMX_HELPER_INTERFACE_MODE_RGMII'
The '==' operator has higher precedence than the '&&' and '||' operators.
Removing the unnecessary parentheses simplifies the code while maintaining
the correct order of operations, making it more readable.
Signed-off-by: Dorine Tipo <dorine.a.tipo@gmail.com>
---
drivers/staging/octeon/ethernet-rgmii.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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);
}
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: Remove unnecessary parentheses
2023-10-29 18:54 [PATCH] staging: Remove unnecessary parentheses Dorine Tipo
@ 2023-10-30 12:06 ` Bagas Sanjaya
2023-10-30 12:40 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Bagas Sanjaya @ 2023-10-30 12:06 UTC (permalink / raw)
To: Dorine Tipo, outreachy, gregkh
[-- Attachment #1: Type: text/plain, Size: 875 bytes --]
On Sun, Oct 29, 2023 at 06:54:05PM +0000, Dorine Tipo wrote:
> 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);
> }
>
I'd prefer explicit parens on the right-hand side of || instead (to match
the left-hand one).
Thanks.
--
An old man doll... just what I always wanted! - Clara
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: Remove unnecessary parentheses
2023-10-30 12:06 ` Bagas Sanjaya
@ 2023-10-30 12:40 ` Greg KH
2023-10-30 13:30 ` Bagas Sanjaya
0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2023-10-30 12:40 UTC (permalink / raw)
To: Bagas Sanjaya; +Cc: Dorine Tipo, outreachy
On Mon, Oct 30, 2023 at 07:06:23PM +0700, Bagas Sanjaya wrote:
> On Sun, Oct 29, 2023 at 06:54:05PM +0000, Dorine Tipo wrote:
> > 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);
> > }
> >
>
> I'd prefer explicit parens on the right-hand side of || instead (to match
> the left-hand one).
Sorry, but as always for this type of change, I will reject it so
there's no need to ask for it to be cleaned up any other way.
Dorine, this type of change is constantly rejected on the mailing list
that you should be copying all of these patches to. Please search the
archives for reasons why.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: Remove unnecessary parentheses
2023-10-30 12:40 ` Greg KH
@ 2023-10-30 13:30 ` Bagas Sanjaya
0 siblings, 0 replies; 4+ messages in thread
From: Bagas Sanjaya @ 2023-10-30 13:30 UTC (permalink / raw)
To: Greg KH; +Cc: Dorine Tipo, Linux Outreachy
[-- Attachment #1: Type: text/plain, Size: 1665 bytes --]
On Mon, Oct 30, 2023 at 01:40:14PM +0100, Greg KH wrote:
> On Mon, Oct 30, 2023 at 07:06:23PM +0700, Bagas Sanjaya wrote:
> > On Sun, Oct 29, 2023 at 06:54:05PM +0000, Dorine Tipo wrote:
> > > 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);
> > > }
> > >
> >
> > I'd prefer explicit parens on the right-hand side of || instead (to match
> > the left-hand one).
>
> Sorry, but as always for this type of change, I will reject it so
> there's no need to ask for it to be cleaned up any other way.
Oh dear! That's what I mean (keeping the status quo/code unchanged).
>
> Dorine, this type of change is constantly rejected on the mailing list
> that you should be copying all of these patches to. Please search the
> archives for reasons why.
Greg has review discussions on why it is the case ([1] and [2]).
[1]: https://lore.kernel.org/all/Y%2FiaYtKk4VSokAFz@kroah.com/
[2]: https://lore.kernel.org/all/20190401060216.GA5286@kroah.com/
Thanks.
--
An old man doll... just what I always wanted! - Clara
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-10-30 13:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-29 18:54 [PATCH] staging: Remove unnecessary parentheses Dorine Tipo
2023-10-30 12:06 ` Bagas Sanjaya
2023-10-30 12:40 ` Greg KH
2023-10-30 13:30 ` Bagas Sanjaya
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.