Skip to content

Commit 27e0bcd

Browse files
andy-shevgregkh
authored andcommitted
device property: Drop redundant NULL checks
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>
1 parent c8dcf65 commit 27e0bcd

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

drivers/base/swnode.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -413,9 +413,6 @@ software_node_get_name(const struct fwnode_handle *fwnode)
413413
{
414414
const struct swnode *swnode = to_swnode(fwnode);
415415

416-
if (!swnode)
417-
return "(null)";
418-
419416
return kobject_name(&swnode->kobj);
420417
}
421418

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

510-
if (!swnode)
511-
return -ENOENT;
512-
513507
prop = property_entry_get(swnode->node->properties, propname);
514508
if (!prop)
515509
return -ENOENT;

0 commit comments

Comments
 (0)