* [PATCH v1 1/1] device property: Drop redundant NULL checks
@ 2021-10-26 16:29 Andy Shevchenko
2021-10-26 16:52 ` Rafael J. Wysocki
0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2021-10-26 16:29 UTC (permalink / raw)
To: Greg Kroah-Hartman, Heikki Krogerus, linux-acpi, linux-kernel
Cc: Andy Shevchenko, Rafael J. Wysocki, Sakari Ailus, YE Chengfeng
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1 1/1] device property: Drop redundant NULL checks
2021-10-26 16:29 [PATCH v1 1/1] device property: Drop redundant NULL checks Andy Shevchenko
@ 2021-10-26 16:52 ` Rafael J. Wysocki
2021-10-26 17:13 ` Greg Kroah-Hartman
0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2021-10-26 16:52 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Greg Kroah-Hartman, Heikki Krogerus, ACPI Devel Maling List,
Linux Kernel Mailing List, Rafael J. Wysocki, Sakari Ailus,
YE Chengfeng
On Tue, Oct 26, 2021 at 6:30 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> 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>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
or please let me know if I need to pick this up.
> ---
> 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
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1 1/1] device property: Drop redundant NULL checks
2021-10-26 16:52 ` Rafael J. Wysocki
@ 2021-10-26 17:13 ` Greg Kroah-Hartman
0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2021-10-26 17:13 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Andy Shevchenko, Heikki Krogerus, ACPI Devel Maling List,
Linux Kernel Mailing List, Sakari Ailus, YE Chengfeng
On Tue, Oct 26, 2021 at 06:52:39PM +0200, Rafael J. Wysocki wrote:
> On Tue, Oct 26, 2021 at 6:30 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > 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>
>
> Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> or please let me know if I need to pick this up.
I can take it, thanks!
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-10-26 17:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-26 16:29 [PATCH v1 1/1] device property: Drop redundant NULL checks Andy Shevchenko
2021-10-26 16:52 ` Rafael J. Wysocki
2021-10-26 17:13 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox