Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1504082
| From | Sudeep Holla <sudeep.holla@arm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v4 2/8] scpi: Add alternative legacy structures, functions and macros |
| Date | 2016-10-19 18:30 +0200 |
| Message-ID | <su1KX-3Hg-49@gated-at.bofh.it> (permalink) |
| References | (1 earlier) <soOY2-67p-27@gated-at.bofh.it> <sqJUe-2o9-13@gated-at.bofh.it> <stbt0-12r-3@gated-at.bofh.it> <ste7v-2Kh-11@gated-at.bofh.it> <su0cb-2v4-113@gated-at.bofh.it> |
| Organization | ARM |
On 19/10/16 11:28, Neil Armstrong wrote:
> On 10/17/2016 01:16 PM, Sudeep Holla wrote:
[...]
>>
>> and the above 2 can be moved out of the conditions, no ?
>>
>> if (scpi_info->is_legacy) {
>> struct legacy_scpi_shared_mem *mem = ch->rx_payload;
>> len = match->rx_len;
>> } else {
>> struct scpi_shared_mem *mem = ch->rx_payload;
>> len = min(match->rx_len, CMD_SIZE(cmd));
>> }
>> match->status = le32_to_cpu(mem->status);
>> memcpy_fromio(match->rx_buf, mem->payload, len);
>>
>> should work.
>
> Well, we will have "error: ‘mem’ undeclared (first use in this
> function)" since mem is not declared outside the if/else.
>
> I don't see good solutions even with an union.
Right, I missed to see that. You can leave it as you had before then.
[...]
>>>>> if (t->rx_buf) {
>>>>> if (!(++ch->token))
>>>>> ++ch->token;
>>>>> ADD_SCPI_TOKEN(t->cmd, ch->token);
>>>>> + if (scpi_info->is_legacy)
>>>>> + t->slot = t->cmd;
>>>>
>>>> I thought passing token was not an issue from your previous response,
>>>> but you are overriding it here, why ?
>>>
>>> Indeed, I can leave it, but it's useless since it won't serve to
>>> distinguish multiple similar commands.
>>>
>>
>> OK, I don't see any point in such micro optimization, so please retain it.
>>
>
> I misread my code, I leaved the token passing, but I copy back the
> cmd to the slot which is used by the MHU.
> If I remove the "t->slot = t->cmd;", the token won't be passed to the
> FW.
>
Right, sorry I think I misled you :)
--
Regards,
Sudeep
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH v4 2/8] scpi: Add alternative legacy structures, functions and macros Neil Armstrong <narmstrong@baylibre.com> - 2016-10-17 10:30 +0200
Re: [PATCH v4 2/8] scpi: Add alternative legacy structures, functions and macros Sudeep Holla <sudeep.holla@arm.com> - 2016-10-17 13:20 +0200
Re: [PATCH v4 2/8] scpi: Add alternative legacy structures, functions and macros Neil Armstrong <narmstrong@baylibre.com> - 2016-10-19 16:40 +0200
Re: [PATCH v4 2/8] scpi: Add alternative legacy structures, functions and macros Sudeep Holla <sudeep.holla@arm.com> - 2016-10-19 18:20 +0200
Re: [PATCH v4 2/8] scpi: Add alternative legacy structures, functions and macros Sudeep Holla <sudeep.holla@arm.com> - 2016-10-19 18:30 +0200
csiph-web