lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 24 Nov 2022 15:38:24 +0100
From:   Marc Kleine-Budde <mkl@...gutronix.de>
To:     Yasushi SHOJI <yasushi.shoji@...il.com>
Cc:     Vincent Mailhol <vincent.mailhol@...il.com>,
        Yasushi SHOJI <yashi@...cecubics.com>,
        Wolfgang Grandegger <wg@...ndegger.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, linux-can@...r.kernel.org,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] can: mcba_usb: Fix termination command argument

On 24.11.2022 18:52:14, Yasushi SHOJI wrote:
> On Thu, Nov 24, 2022 at 9:53 AM Vincent Mailhol
> <vincent.mailhol@...il.com> wrote:
> > > diff --git a/drivers/net/can/usb/mcba_usb.c b/drivers/net/can/usb/mcba_usb.c
> > > index 218b098b261d..67beff1a3876 100644
> > > --- a/drivers/net/can/usb/mcba_usb.c
> > > +++ b/drivers/net/can/usb/mcba_usb.c
> > > @@ -785,9 +785,9 @@ static int mcba_set_termination(struct net_device *netdev, u16 term)
> > >         };
> > >
> > >         if (term == MCBA_TERMINATION_ENABLED)
> > > -               usb_msg.termination = 1;
> > > -       else
> > >                 usb_msg.termination = 0;
> > > +       else
> > > +               usb_msg.termination = 1;
> > >
> > >         mcba_usb_xmit_cmd(priv, (struct mcba_usb_msg *)&usb_msg);
> >
> > Nitpick: does it make sense to rename the field to something like
> > usb_msg.termination_disable or usb_msg.termination_off? This would
> > make it more explicit that this is a "reverse" boolean.
> 
> I'd rather define the values like
> 
> #define TERMINATION_ON (0)
> #define TERMINATION_OFF (1)
> 
> So the block becomes
> 
> if (term == MCBA_TERMINATION_ENABLED)
>     usb_msg.termination = TERMINATION_ON;
> else
>     usb_msg.termination = TERMINATION_OFF;

Please send a v2 patch, using git send-email, as you did with the first
version. (No compressed attached patches please.)

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ