Skip to content

Commit

Permalink
device property: Drop redundant NULL checks
Browse files Browse the repository at this point in the history
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>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20211026162954.89811-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
andy-shev authored and gregkh committed Oct 26, 2021
1 parent c8dcf65 commit 27e0bcd
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions drivers/base/swnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 27e0bcd

Please sign in to comment.