lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <YaBl2PMPHnOMGKY+@google.com>
Date:   Fri, 26 Nov 2021 12:43:04 +0800
From:   Tzung-Bi Shih <tzungbi@...gle.com>
To:     "allen-kh.cheng" <allen-kh.cheng@...iatek.com>
Cc:     Jassi Brar <jassisinghbrar@...il.com>,
        Rob Herring <robh+dt@...nel.org>,
        Matthias Brugger <matthias.bgg@...il.com>,
        devicetree@...r.kernel.org,
        Linux-ALSA <alsa-devel@...a-project.org>,
        Kai Vehmanen <kai.vehmanen@...ux.intel.com>,
        Liam Girdwood <lgirdwood@...il.com>, cujomalainey@...gle.com,
        linux-kernel@...r.kernel.org, Takashi Iwai <tiwai@...e.com>,
        Ranjani Sridharan <ranjani.sridharan@...ux.intel.com>,
        Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
        Project_Global_Chrome_Upstream_Group@...iatek.com,
        Mark Brown <broonie@...nel.org>,
        linux-mediatek@...ts.infradead.org,
        Daniel Baluta <daniel.baluta@....com>,
        linux-arm-kernel@...ts.infradead.org,
        sound-open-firmware@...a-project.org
Subject: Re: [PATCH v4 2/3] firmware: mediatek: add adsp ipc protocol
 interface

On Thu, Nov 25, 2021 at 08:29:24PM +0800, allen-kh.cheng wrote:
> diff --git a/drivers/firmware/mediatek/mtk-adsp-ipc.c b/drivers/firmware/mediatek/mtk-adsp-ipc.c
[...]
> +static void adsp_ipc_recv(struct mbox_client *c, void *msg)
> +{
> +	struct mtk_adsp_chan *chan = container_of(c, struct mtk_adsp_chan, cl);
> +
> +	if (chan->idx == MTK_ADSP_MBOX_REPLY)
> +		chan->ipc->ops->handle_reply(chan->ipc);
> +	else
> +		chan->ipc->ops->handle_request(chan->ipc);

Using switch ... case ... makes the intention more clear.

> +static int mtk_adsp_ipc_probe(struct platform_device *pdev)
> +{
[...]
> +	for (i = 0; i < MTK_ADSP_MBOX_NUM; i++) {
> +		chan_name = kasprintf(GFP_KERNEL, "mbox%d", i);
> +		if (!chan_name)
> +			return -ENOMEM;

It needs to go error handling path.

> +static int mtk_adsp_remove(struct platform_device *pdev)
> +{
> +	struct mtk_adsp_chan *dsp_chan;
> +	struct mtk_adsp_ipc *dsp_ipc;
> +	int i;
> +
> +	dsp_ipc = dev_get_drvdata(&pdev->dev);

To be concise, I would prefer dev_get_drvdata() inline to the line where the variable is declared.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ