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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux