Re: [libgpiod][PATCH] tools: gpiomon: fix setting event clock type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 15 Mar 2023 at 15:04, Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
>
> On Wed, Mar 15, 2023 at 09:44:17AM +0100, Linus Walleij wrote:
> > On Wed, Mar 15, 2023 at 9:35 AM Bartosz Golaszewski <brgl@xxxxxxxx> wrote:
> >
> > > From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
> > >
> > > Fix an inverted logic bug when parsing event clock type in gpiomon.
> > >
> > > Fixes: 8ffb6489286f ("tools: line name focussed rework")
> > > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
> > > Reported-by: Wes Tarro <wes.tarro@xxxxxxxxxxxxxxx>
> >
> > Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
> >
> > > -       if (strcmp(option, "hte") != 0)
> > > +       if (strcmp(option, "hte") == 0)
> >
> > I tend to code if (!strcmp(option, "hte")) but taste differs.
>
> Pity we don't have match_string() API in a libc or somewhere in the user space.
> Allows to avoid such mistakes at once.
>

We have several instances of such string parsing in tools/ in libgpiod
so feel free to add and use it. You can even port linux code verbatim
- libgpiod is GPL after all. :)

Bart




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux