lkml.org 
[lkml]   [2021]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1 1/1] device property: Drop redundant NULL checks
Date
In cases when functions are called via fwnode operations,
we already know that this is software node we are dealing
with, hence no need to check if it's NULL, it can't be,

Reported-by: YE Chengfeng <cyeaa@connect.ust.hk>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/base/swnode.c | 6 ------
1 file changed, 6 deletions(-)

diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c
index c46f6a8e14d2..4debcea4fb12 100644
--- a/drivers/base/swnode.c
+++ b/drivers/base/swnode.c
@@ -413,9 +413,6 @@ software_node_get_name(const struct fwnode_handle *fwnode)
{
const struct swnode *swnode = to_swnode(fwnode);

- if (!swnode)
- return "(null)";
-
return kobject_name(&swnode->kobj);
}

@@ -507,9 +504,6 @@ software_node_get_reference_args(const struct fwnode_handle *fwnode,
int error;
int i;

- if (!swnode)
- return -ENOENT;
-
prop = property_entry_get(swnode->node->properties, propname);
if (!prop)
return -ENOENT;
--
2.33.0
\
 
 \ /
  Last update: 2021-10-26 18:30    [W:0.033 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site