lkml.org 
[lkml]   [2020]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 5/7] remoteproc: Restructure firmware name allocation
Date
Improve the readability of function rproc_alloc_firmware() by using
a non-negated condition.

Suggested-by: Alex Elder <elder@linaro.org>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
---
drivers/remoteproc/remoteproc_core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index ebaff496ef81..0bfa6998705d 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -1984,14 +1984,14 @@ static int rproc_alloc_firmware(struct rproc *rproc,
{
const char *p;

- if (!firmware)
+ if (firmware)
+ p = kstrdup_const(firmware, GFP_KERNEL);
+ else
/*
* If the caller didn't pass in a firmware name then
* construct a default name.
*/
p = kasprintf(GFP_KERNEL, "rproc-%s-fw", name);
- else
- p = kstrdup_const(firmware, GFP_KERNEL);

if (!p)
return -ENOMEM;
--
2.20.1
\
 
 \ /
  Last update: 2020-04-15 22:52    [W:0.143 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site