[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<DS0PR11MB80508EB3EDB6C342CE1D7AB983512@DS0PR11MB8050.namprd11.prod.outlook.com>
Date: Mon, 4 Nov 2024 05:00:03 +0000
From: <Mohan.Prasad@...rochip.com>
To: <mkubecek@...e.cz>
CC: <f.pfitzner@...gutronix.de>, <netdev@...r.kernel.org>,
<kory.maincent@...tlin.com>, <davem@...emloft.net>, <kuba@...nel.org>,
<andrew@...n.ch>, <Anbazhagan.Sakthivel@...rochip.com>,
<Nisar.Sayed@...rochip.com>
Subject: RE: [PATCH ethtool] netlink: settings: Fix for wrong auto-negotiation
state
Hello Michal,
Thank you for the comments.
> On Wed, Oct 16, 2024 at 09:28:47AM +0530, Mohan Prasad J wrote:
> > Auto-negotiation state in json format showed the opposite state due to
> > wrong comparison.
> > Fix for returning the correct auto-neg state implemented.
> >
> > Signed-off-by: Mohan Prasad J <mohan.prasad@...rochip.com>
> > ---
> > netlink/settings.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/netlink/settings.c b/netlink/settings.c index
> > dbfb520..a454bfb 100644
> > --- a/netlink/settings.c
> > +++ b/netlink/settings.c
> > @@ -546,7 +546,7 @@ int linkmodes_reply_cb(const struct nlmsghdr
> *nlhdr, void *data)
> > (autoneg ==
> AUTONEG_DISABLE) ? "off" : "on");
> > else
> > print_bool(PRINT_JSON, "auto-negotiation", NULL,
> > - autoneg == AUTONEG_DISABLE);
> > + (autoneg == AUTONEG_DISABLE) ? false :
> true);
> > }
> > if (tb[ETHTOOL_A_LINKMODES_MASTER_SLAVE_CFG]) {
> > uint8_t val;
>
> The fix looks correct but isn't
>
> (autoneg == AUTONEG_DISABLE) ? false : true
>
> just a more complicated way to say
>
> autoneg != AUTONEG_DISABLE
>
> (and harder to read)?
You are right. (autoneg != AUTONEG_DISABLE) would be more simpler and easy to read. I will update it in the next version.
Thanks,
Mohan Prasad J
Powered by blists - more mailing lists