lkml.org 
[lkml]   [2018]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 15/21] ALSA: oxygen: use match_string() helper
On Thu, 31 May 2018 21:02:05 +0200,
Andy Shevchenko wrote:
>
> On Thu, May 31, 2018 at 9:59 PM, Takashi Iwai <tiwai@suse.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@huawei.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!

OK, let's take as is.


thanks,

Takashi

\
 
 \ /
  Last update: 2018-05-31 22:31    [W:0.146 / U:1.712 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site