[PATCH] coresight: fix missing error code when trace ID is invalid

Suzuki K Poulose suzuki.poulose at arm.com
Fri May 8 07:00:28 PDT 2026


On 08/05/2026 14:44, Leo Yan wrote:
> On Fri, May 08, 2026 at 01:45:35PM +0800, Jie Gan wrote:
> 
> [...]
> 
>>   	coresight_path_assign_trace_id(path, CS_MODE_SYSFS);
>> -	if (!IS_VALID_CS_TRACE_ID(path->trace_id))
>> +	if (!IS_VALID_CS_TRACE_ID(path->trace_id)) {
>> +		ret = -EINVAL;
>>   		goto err_path;
>> +	}
> 
> On the top of this patch, could we do a further improvement?
> 
> Move IS_VALID_CS_TRACE_ID() into coresight_path_assign_trace_id() and
> return 0 for success and < 0 for failures. As result, callers only
> need to check the returned value.

Yes please ^

Cheers
Suzuki


> 
> For this patch:
> 
> Reviewed-by: Leo Yan <leo.yan at arm.com>




More information about the linux-arm-kernel mailing list