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:   Tue, 22 May 2018 08:55:37 +0800
From:   Yisheng Xie <xieyisheng1@...wei.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
CC:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Ganesh Goudar <ganeshgr@...lsio.com>,
        netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH 05/33] cxgb4: use match_string() helper

Hi Andy,

On 2018/5/22 5:39, Andy Shevchenko wrote:
> On Mon, May 21, 2018 at 2:57 PM, Yisheng Xie <xieyisheng1@...wei.com> wrote:
>> match_string() returns the index of an array for a matching string,
>> which can be used intead of open coded variant.
> 
>> -       for (i = 0; i < ARRAY_SIZE(cudbg_region); i++) {
>> -               if (!strcmp(cudbg_region[i], region_name)) {
>> -                       found = 1;
>> -                       idx = i;
>> -                       break;
>> -               }
>> -       }
>> -       if (!found)
>> -               return -EINVAL;
>> +       rc = match_string(cudbg_region, ARRAY_SIZE(cudbg_region), region_name);
>> +       if (rc < 0)
>> +               return rc;
>>
>> -       found = 0;
>> +       idx = rc;
> 
> Is found still in use after this?
> If so, is it initialized properly now?
it is initialized  when define 'found', so no need to be initialized once more.

Thanks
Yisheng

> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ