[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200421015650.GH1868936@builder.lan>
Date: Mon, 20 Apr 2020 18:56:50 -0700
From: Bjorn Andersson <bjorn.andersson@...aro.org>
To: Mathieu Poirier <mathieu.poirier@...aro.org>
Cc: ohad@...ery.com, elder@...aro.org, s-anna@...com,
Markus.Elfring@....de, linux-remoteproc@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 2/4] remoteproc: Restructure firmware name allocation
On Mon 20 Apr 16:15 PDT 2020, Mathieu Poirier wrote:
> Improve the readability of function rproc_alloc_firmware() by using
> a non-negated condition and moving the comment out of the conditional
> block
>
> Suggested-by: Alex Elder <elder@...aro.org>
> Signed-off-by: Mathieu Poirier <mathieu.poirier@...aro.org>
> Reviewed-by: Alex Elder <elder@...aro.org>
Looks better, thanks for respinning.
Reviewed-by: Bjorn Andersson <bjorn.andersson@...aro.org>
Regards,
Bjorn
> ---
> drivers/remoteproc/remoteproc_core.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
> index db8a15fc1e4a..45529d40342f 100644
> --- a/drivers/remoteproc/remoteproc_core.c
> +++ b/drivers/remoteproc/remoteproc_core.c
> @@ -2011,14 +2011,14 @@ static int rproc_alloc_firmware(struct rproc *rproc,
> {
> const char *p;
>
> - if (!firmware)
> - /*
> - * If the caller didn't pass in a firmware name then
> - * construct a default name.
> - */
> - p = kasprintf(GFP_KERNEL, "rproc-%s-fw", name);
> - else
> + /*
> + * Allocate a firmware name if the caller gave us one to work
> + * with. Otherwise construct a new one using a default pattern.
> + */
> + if (firmware)
> p = kstrdup_const(firmware, GFP_KERNEL);
> + else
> + p = kasprintf(GFP_KERNEL, "rproc-%s-fw", name);
>
> if (!p)
> return -ENOMEM;
> --
> 2.20.1
>
Powered by blists - more mailing lists