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:	Wed, 5 Jun 2013 20:54:42 +0800
From:	Ming Lei <ming.lei@...onical.com>
To:	Takashi Iwai <tiwai@...e.de>
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-kernel@...r.kernel.org,
	Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH 3/3] firmware loader: allow distribution to choose default
 search paths

On Wed, Jun 5, 2013 at 8:45 PM, Takashi Iwai <tiwai@...e.de> wrote:
> At Wed, 5 Jun 2013 20:36:19 +0800,
> Ming Lei wrote:
>>
>> On Wed, Jun 5, 2013 at 7:57 PM, Takashi Iwai <tiwai@...e.de> wrote:
>> >
>> > Hmm, separating with semicolons isn't so common, but we can live with
>>
>> Looks there are seldom such usage patterns in kernel, so could you let me
>> know which separator is more common?
>
> $PATH uses colon, but I don't know of many others.

OK, will change to colon to keep consistent with $PATH.

>
>> > it.  I thought the previous loop can be kept but just pass each member
>> > to fw_get_file_firmware() unconditionally.  This will reduce the
>> > changes, I guess.  But it's just a matter of taste, here is no
>> > critically hot path, after all.
>>
>> Yes, aother way is to move 'fw_path_para' out of fw_path[], and only
>> let  fw_get_fw_file_from_paths() deal with 'fw_path_para' and
>> CONFIG_FW_CUSTOMIZED_PATH. Looks it is still clean.
>
> Why not just pass all strings to fw_get_fw_file_from_paths(), no
> matter whether it's a single or multiple path strings?
>
> static const char * const fw_path[] = {
>         fw_path_para,
> #ifdef CONFIG_FW_CUSTOMIZED_PATH
>         CONFIG_FW_CUSTOMIZED_PATH,
> #endif
>         "/lib/firmware/updates/" UTS_RELEASE,
>         "/lib/firmware/updates",
>         "/lib/firmware/" UTS_RELEASE,
> };
>
> ....
>
>         for (i = 0; i < ARRAY_SIZE(fw_path); i++) {
>                 /* skip the unset customized path */
>                 if (!fw_path[i][0])
>                         continue;
>                 success = fw_get_fw_file_from_paths(fw_path[i], path, buf);
>                 if (success)
>                         break;
>         }

Good, this approach is very clean, and I will take it, :-)

Thanks,
--
Ming Lei
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ