[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210205142516.GC4720@sirena.org.uk>
Date: Fri, 5 Feb 2021 14:25:16 +0000
From: Mark Brown <broonie@...nel.org>
To: Shengjiu Wang <shengjiu.wang@....com>
Cc: lgirdwood@...il.com, perex@...ex.cz, tiwai@...e.com,
alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
timur@...nel.org, nicoleotsuka@...il.com, Xiubo.Lee@...il.com,
festevam@...il.com, linuxppc-dev@...ts.ozlabs.org,
robh+dt@...nel.org, devicetree@...r.kernel.org
Subject: Re: [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?
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists