Re: [PATCH v3 3/3] platform/x86: think-lmi: use correct possible_values delimters

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

 



Thanks Barnabas,

On Sat, Mar 18, 2023, at 10:37 AM, Barnabás Pőcze wrote:
> Hi
>
>
> 2023. március 17., péntek 16:46 keltezéssel, Mark Pearson 
> <mpearson-lenovo@xxxxxxxxx> írta:
>
>> firmware-attributes class requires that possible values are delimited
>> using ';' but the Lenovo firmware uses ',' instead.
>> Parse string and replace where appropriate
>> 
>> Thanks to Thomas W for pointing this out.
>> 
>> Signed-off-by: Mark Pearson <mpearson-lenovo@xxxxxxxxx>
>> ---
>> [...]
>> +		/*
>> +		 * firmware-attributes requires that possible_values are separated by ';' but
>> +		 * Lenovo FW uses ','. Replace appropriately.
>> +		 */
>> +		if (setting->possible_values) {
>> +			char *tmp = setting->possible_values;
>> +
>> +			while ((tmp = strchr(tmp, ',')) != NULL)
>> +				*tmp++ = ';';
>> +		}
>
> Please see `strreplace()` from `linux/string.h`.
Ah - I looked for that and didn't find it. Thank you (and will do)

>
>
>> +
>>  		kobject_init(&setting->kobj, &tlmi_attr_setting_ktype);
>>  		tlmi_priv.setting[i] = setting;
>>  		kfree(item);
>> --
>> 2.39.2
>
>
> Regards,
> Barnabás Pőcze




[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux