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] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 31 May 2018 22:02:05 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Takashi Iwai <tiwai@...e.de>
Cc:     Yisheng Xie <xieyisheng1@...wei.com>,
        ALSA Development Mailing List <alsa-devel@...a-project.org>,
        Clemens Ladisch <clemens@...isch.de>,
        Jaroslav Kysela <perex@...ex.cz>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 15/21] ALSA: oxygen: use match_string() helper

On Thu, May 31, 2018 at 9:59 PM, Takashi Iwai <tiwai@...e.de> wrote:
> On Thu, 31 May 2018 20:41:36 +0200,
> Andy Shevchenko wrote:
>> On Thu, May 31, 2018 at 2:11 PM, Yisheng Xie <xieyisheng1@...wei.com> wrote:

>> > +               j = match_string(known_ctl_names, CONTROL_COUNT, ctl->id.name);
>> > +               if (j >= 0) {
>> > +                       chip->controls[j] = ctl;
>> > +                       ctl->private_free = oxygen_any_ctl_free;
>> > +               }
>>
>> It looks to me you may get rid of j completely by utilizing existing err.
>
> Well, err isn't ideal as it's referred as the actual index.
> That is, the line below looks weird to me:
>         chip->controls[err] = ctl;
>
> Of course, j isn't the best name, either, but at least, keeping the
> same variable makes the code conversion logic clearer.

Works for me either way.
Thanks!

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ