mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
remoteproc: Restructure firmware name allocation
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@linaro.org> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Alex Elder <elder@linaro.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20200420231601.16781-3-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
parent
1487deda19
commit
9d5f82c8ba
1 changed files with 7 additions and 7 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue