Received: by 2002:a05:6520:2f93:b029:af:d4db:7a05 with SMTP id 19csp2377485lkf; Fri, 5 Feb 2021 11:32:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJwcLvHSaDpTuxPJEBCpWny4vJ/JChieNPpqSyjeJCMDAUhEXaLoKr6WdXFF4U8VepvSGW/f X-Received: by 2002:a05:6402:1642:: with SMTP id s2mr4984533edx.360.1612553569497; Fri, 05 Feb 2021 11:32:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612553569; cv=none; d=google.com; s=arc-20160816; b=GgCoh6wk+x7fbPOkdwO26OhgkMIvI3u6uaTgurnmcA3dj1adf+Idqy2My9seHVW2nV BncE/EFx6IziZeJr6WO6Z/uT631Q6a1a3Lpfxoeb84l7EqdDK91bSvTWHwELnFuk6GgS FGaLw81DuGDhQbcksLYwX/eRGHtSZg+dSWp3TLfaUj2DdFWc+U14mhmECZpKks0IFdWs qFMSZpNjj0hnabAis3Hk14Kgne1uD2Q8TgPikf516wOVDq2Q3As97PE6nGyecgS4axtv jK0Z0zS7QPNhbXleB2/AhFVEW0y605b4R30/zNVoXR92F3SSmB9Y2WhzyNKpRmcosQ4i 64Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=yUCSZ+j+xVLknInPkzvZQNIONpZcwkboX0guUczKU1c=; b=mL9gFjcf0r7cR2zb3Pw6+sajfADRU4uuzII/qGx18dP/pXXZdnjtEqrvk77Sccos3K BRbExC/oc130f1p5bURf4OfxGS/qHegs/d2td5xDDVtMr3CLWbv6VeIgszmaIPdzdmWc HkahEO1V5EwHqpFsa/7b8t2jnethnI4Xv5gBvzJQkaiXSxGGrwiCQUPXdAHcQWCXW56V QuN5RtrEmAKgfk16j6+X/Fm8ZiAYvKlMoLBjzDBmQmbWlG3NH9Qp7SSsy+xZ7GOo1wBW kWaKQLGLzjTgkQ0BzPCXyPCZWFei7LbKAKa9y/pE3rj4dUmcPJ47jecFFHgi5Xbf5IFz gAuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Us2R3OO+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h6si5929131edn.21.2021.02.05.11.32.24; Fri, 05 Feb 2021 11:32:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Us2R3OO+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233338AbhBERtF (ORCPT + 99 others); Fri, 5 Feb 2021 12:49:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:53432 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233393AbhBEPyg (ORCPT ); Fri, 5 Feb 2021 10:54:36 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id ECCE6650CE; Fri, 5 Feb 2021 14:26:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612535166; bh=vz0EpXJayRiYNc5TflA7y0RwX1/hD5Z5cZtbGrJpFV0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Us2R3OO+4Wcy6hSv5VXYsF1KTJF/+0jcxZVFjtlnH4Z2jMuj41U2+Nklg6BH+Gx3A uulzEKrbnFji+Fw/sUCqG571ha2Uew4bvTQT5RL/4G6H67Jpvs+g+SAlk4bvHwQVtE 58nU8jYVraXqyC5f6wEWex0/cLQOWuJKUYafnXhBOyEXWNQgFq6mzMBjfo2kB5AIO9 zG4tZc+WlhpuACHGrQLKhXRCiRb9vqOhzbnLEMg7TsN/UXyeicMwrBq2kN863+Tjjp fjzAhkE+LOvTGf6TAcnTItnT3Usc/qpztnZz2J04qniMkT1VQ44WnL0a4HOYh/dGMR bEfvshfep5Lcw== Date: Fri, 5 Feb 2021 14:25:16 +0000 From: Mark Brown To: Shengjiu Wang Cc: lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, timur@kernel.org, nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, linuxppc-dev@lists.ozlabs.org, robh+dt@kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH 4/7] ASoC: imx-audio-rpmsg: Add rpmsg_driver for audio channel Message-ID: <20210205142516.GC4720@sirena.org.uk> References: <1612508250-10586-1-git-send-email-shengjiu.wang@nxp.com> <1612508250-10586-5-git-send-email-shengjiu.wang@nxp.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="E13BgyNx05feLLmH" Content-Disposition: inline In-Reply-To: <1612508250-10586-5-git-send-email-shengjiu.wang@nxp.com> X-Cookie: Huh? User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --E13BgyNx05feLLmH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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? --E13BgyNx05feLLmH Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmAdVUsACgkQJNaLcl1U h9C97Af/adbNIcFNxOngffC2op8D1lsnbPhhXftOmDlTLcbbbFG1hQeuCEHsljRt 50gewIr1JVY2DkjhAGhtO0GkX+0VpXHSqkwPYv33tOAFJTFcODtVao9i1csmyXu8 V7i4RUPJilR6VTJiFaKLZQPL3bNUeZ+/KfqNvf/jGSydI5OqKGuH2PiomH9lEOwR xeteoRMiPCLSxtA2+AaKVDR85e1eJkxx3qVRWuccdOkNNjSZRbvh+ViytXoAkLQj qM7JYdtZd/ZbDagmISJiZM57cVv+ql+5Rw+B4Wb1pzxcwCbKNB6qEUmRmuD2OO+W aBb9j6QHazt7nhnsb/x34Dx2M/D1WQ== =ULPb -----END PGP SIGNATURE----- --E13BgyNx05feLLmH--