Re: [PATCH 1/2] firmware: qcom: scm: Return -EOPNOTSUPP for unsupported SHM bridge enabling

From: Kuldeep Singh
Date: Sun Oct 06 2024 - 18:01:56 EST



>> int qcom_scm_shm_bridge_enable(void)
>> {
>> + int ret;
>> +
>> struct qcom_scm_desc desc = {
>> .svc = QCOM_SCM_SVC_MP,
>> .cmd = QCOM_SCM_MP_SHM_BRIDGE_ENABLE,
>> @@ -1373,7 +1379,11 @@ int qcom_scm_shm_bridge_enable(void)
>> QCOM_SCM_MP_SHM_BRIDGE_ENABLE))
>> return -EOPNOTSUPP;
>>
>> - return qcom_scm_call(__scm->dev, &desc, &res) ?: res.result[0];
>> + ret = qcom_scm_call(__scm->dev, &desc, &res);
>> + if (!ret && res.result[0] == SHMBRIDGE_RESULT_NOTSUPP)
>> + return -EOPNOTSUPP;
>> +
>> + return ret ?: res.result[0];
>
> Could you please make it less cryptic?
>
> if (ret)
> return ret;
>
> if (res.result[0] == SHMBRIDGE_RESULT_NOTSUPP)
> return -EOPNOTSUPP;
>
> return res.result[0];

Sure Dmitry, this looks more cleaner.
Will update in next rev.

--
Regards
Kuldeep