From: Hari Nagalla <hnagalla@ti.com>
To: Andrew Davis <afd@ti.com>, Bjorn Andersson <andersson@kernel.org>,
Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: <linux-remoteproc@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/7] remoteproc: keystone: Use devm_kasprintf() to build name string
Date: Thu, 8 Aug 2024 06:34:26 -0500 [thread overview]
Message-ID: <a48af4c3-1500-ebdf-eaea-732bf06c9df1@ti.com> (raw)
In-Reply-To: <20240802182300.244055-1-afd@ti.com>
On 8/2/24 13:22, Andrew Davis wrote:
> This is simpler and removes the need to assume the id length to be 1
> digit, which then removes a W=1 compile warning about the same.
>
> Signed-off-by: Andrew Davis <afd@ti.com>
Acked/Tested-by: Hari Nagalla <hnagalla@ti.com>
> ---
> drivers/remoteproc/keystone_remoteproc.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/remoteproc/keystone_remoteproc.c b/drivers/remoteproc/keystone_remoteproc.c
> index 7e57b90bcaf85..81b179e269a1e 100644
> --- a/drivers/remoteproc/keystone_remoteproc.c
> +++ b/drivers/remoteproc/keystone_remoteproc.c
> @@ -366,8 +366,6 @@ static int keystone_rproc_probe(struct platform_device *pdev)
> struct rproc *rproc;
> int dsp_id;
> char *fw_name = NULL;
> - char *template = "keystone-dsp%d-fw";
> - int name_len = 0;
> int ret = 0;
>
> if (!np) {
> @@ -382,11 +380,9 @@ static int keystone_rproc_probe(struct platform_device *pdev)
> }
>
> /* construct a custom default fw name - subject to change in future */
> - name_len = strlen(template); /* assuming a single digit alias */
> - fw_name = devm_kzalloc(dev, name_len, GFP_KERNEL);
> + fw_name = devm_kasprintf(dev, GFP_KERNEL, "keystone-dsp%d-fw", dsp_id);
> if (!fw_name)
> return -ENOMEM;
> - snprintf(fw_name, name_len, template, dsp_id);
>
> rproc = rproc_alloc(dev, dev_name(dev), &keystone_rproc_ops, fw_name,
> sizeof(*ksproc));
prev parent reply other threads:[~2024-08-08 11:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-02 18:22 [PATCH 1/7] remoteproc: keystone: Use devm_kasprintf() to build name string Andrew Davis
2024-08-02 18:22 ` [PATCH 2/7] remoteproc: keystone: Use devm_rproc_alloc() helper Andrew Davis
2024-08-02 18:22 ` [PATCH 3/7] remoteproc: keystone: Use devm action to release reserved memory Andrew Davis
2024-08-13 15:55 ` Mathieu Poirier
2024-08-02 18:22 ` [PATCH 4/7] remoteproc: keystone: Use devm_pm_runtime_enable() helper Andrew Davis
2024-08-02 18:22 ` [PATCH 5/7] remoteproc: keystone: Use devm action to call PM runtime put sync Andrew Davis
2024-08-02 18:22 ` [PATCH 6/7] remoteproc: keystone: Use devm_gpiod_get() helper Andrew Davis
2024-08-02 18:23 ` [PATCH 7/7] remoteproc: keystone: Use devm_rproc_add() helper Andrew Davis
2024-08-08 11:34 ` Hari Nagalla [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a48af4c3-1500-ebdf-eaea-732bf06c9df1@ti.com \
--to=hnagalla@ti.com \
--cc=afd@ti.com \
--cc=andersson@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.