Thread (14 messages) 14 messages, 3 authors, 2021-02-07

Re: [PATCH 4/7] ASoC: imx-audio-rpmsg: Add rpmsg_driver for audio channel

From: Shengjiu Wang <shengjiu.wang@gmail.com>
Date: 2021-02-07 09:50:40
Also in: alsa-devel, linux-devicetree, lkml

On Fri, Feb 5, 2021 at 10:27 PM Mark Brown [off-list ref] wrote:
On Fri, Feb 05, 2021 at 02:57:27PM +0800, Shengjiu Wang wrote:
quoted
+     /* TYPE C is notification from M core */
+     if (r_msg->header.type == MSG_TYPE_C) {
+             if (r_msg->header.cmd == TX_PERIOD_DONE) {
quoted
+             } else if (r_msg->header.cmd == RX_PERIOD_DONE) {
A switch statement would be clearer and more extensible...
quoted
+     /* TYPE B is response msg */
+     if (r_msg->header.type == MSG_TYPE_B) {
+             memcpy(&info->r_msg, r_msg, sizeof(struct rpmsg_r_msg));
+             complete(&info->cmd_complete);
+     }
...and make this flow clearer for example.  Do we need to warn on
unknown messages?
Thanks for reviewing. I will update them.

Best regards
wang shengjiu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help