Re: [PATCH v2 06/35] brcmfmac: firmware: Support passing in multiple board_types

From: Hector Martin
Date: Thu Jan 06 2022 - 21:50:45 EST


On 2022/01/04 20:28, Andy Shevchenko wrote:
> On Tue, Jan 4, 2022 at 9:28 AM Hector Martin <marcan@xxxxxxxxx> wrote:
>>
>> In order to make use of the multiple alt_path functionality, change
>> board_type to an array. Bus drivers can pass in a NULL-terminated list
>> of board type strings to try for the firmware fetch.
>
>> + /* strip extension at the end */
>> + strscpy(alt_path, path, BRCMF_FW_NAME_LEN);
>> + alt_path[suffix - path] = 0;
>>
>> - alt_paths[0] = kstrdup(alt_path, GFP_KERNEL);
>> + strlcat(alt_path, ".", BRCMF_FW_NAME_LEN);
>> + strlcat(alt_path, board_types[i], BRCMF_FW_NAME_LEN);
>> + strlcat(alt_path, suffix, BRCMF_FW_NAME_LEN);
>> +
>> + alt_paths[i] = kstrdup(alt_path, GFP_KERNEL);
>> + brcmf_dbg(TRACE, "FW alt path: %s\n", alt_paths[i]);
>
> Consider replacing these string manipulations with kasprintf().
>

Done, thanks!

--
Hector Martin (marcan@xxxxxxxxx)
Public Key: https://mrcn.st/pub