lkml.org 
[lkml]   [2021]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/7] ASoC: imx-audio-rpmsg: Add rpmsg_driver for audio channel
On Fri, Feb 05, 2021 at 02:57:27PM +0800, Shengjiu Wang wrote:

> + /* TYPE C is notification from M core */
> + if (r_msg->header.type == MSG_TYPE_C) {
> + if (r_msg->header.cmd == TX_PERIOD_DONE) {

> + } else if (r_msg->header.cmd == RX_PERIOD_DONE) {

A switch statement would be clearer and more extensible...

> + /* 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?
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-02-05 20:33    [W:0.049 / U:1.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site