* [PATCH v1] device property: Remove duplicate test for NULL
@ 2019-08-23 20:32 Andy Shevchenko
2019-08-26 6:52 ` Sakari Ailus
2019-08-28 9:41 ` Rafael J. Wysocki
0 siblings, 2 replies; 3+ messages in thread
From: Andy Shevchenko @ 2019-08-23 20:32 UTC (permalink / raw)
To: Rafael J. Wysocki, linux-acpi; +Cc: Andy Shevchenko, Sakari Ailus
There is no need to check twice for a NULL in fwnode_call_bool_op().
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
include/linux/fwnode.h | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h
index a11c8c56c78b..ababd6bc82f3 100644
--- a/include/linux/fwnode.h
+++ b/include/linux/fwnode.h
@@ -110,10 +110,11 @@ struct fwnode_operations {
(fwnode ? (fwnode_has_op(fwnode, op) ? \
(fwnode)->ops->op(fwnode, ## __VA_ARGS__) : -ENXIO) : \
-EINVAL)
-#define fwnode_call_bool_op(fwnode, op, ...) \
- (fwnode ? (fwnode_has_op(fwnode, op) ? \
- (fwnode)->ops->op(fwnode, ## __VA_ARGS__) : false) : \
- false)
+
+#define fwnode_call_bool_op(fwnode, op, ...) \
+ (fwnode_has_op(fwnode, op) ? \
+ (fwnode)->ops->op(fwnode, ## __VA_ARGS__) : false)
+
#define fwnode_call_ptr_op(fwnode, op, ...) \
(fwnode_has_op(fwnode, op) ? \
(fwnode)->ops->op(fwnode, ## __VA_ARGS__) : NULL)
--
2.23.0.rc1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1] device property: Remove duplicate test for NULL
2019-08-23 20:32 [PATCH v1] device property: Remove duplicate test for NULL Andy Shevchenko
@ 2019-08-26 6:52 ` Sakari Ailus
2019-08-28 9:41 ` Rafael J. Wysocki
1 sibling, 0 replies; 3+ messages in thread
From: Sakari Ailus @ 2019-08-26 6:52 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: Rafael J. Wysocki, linux-acpi
On Fri, Aug 23, 2019 at 11:32:27PM +0300, Andy Shevchenko wrote:
> There is no need to check twice for a NULL in fwnode_call_bool_op().
>
> Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
--
Sakari Ailus
sakari.ailus@linux.intel.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1] device property: Remove duplicate test for NULL
2019-08-23 20:32 [PATCH v1] device property: Remove duplicate test for NULL Andy Shevchenko
2019-08-26 6:52 ` Sakari Ailus
@ 2019-08-28 9:41 ` Rafael J. Wysocki
1 sibling, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2019-08-28 9:41 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: linux-acpi, Sakari Ailus
On Friday, August 23, 2019 10:32:27 PM CEST Andy Shevchenko wrote:
> There is no need to check twice for a NULL in fwnode_call_bool_op().
>
> Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> include/linux/fwnode.h | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h
> index a11c8c56c78b..ababd6bc82f3 100644
> --- a/include/linux/fwnode.h
> +++ b/include/linux/fwnode.h
> @@ -110,10 +110,11 @@ struct fwnode_operations {
> (fwnode ? (fwnode_has_op(fwnode, op) ? \
> (fwnode)->ops->op(fwnode, ## __VA_ARGS__) : -ENXIO) : \
> -EINVAL)
> -#define fwnode_call_bool_op(fwnode, op, ...) \
> - (fwnode ? (fwnode_has_op(fwnode, op) ? \
> - (fwnode)->ops->op(fwnode, ## __VA_ARGS__) : false) : \
> - false)
> +
> +#define fwnode_call_bool_op(fwnode, op, ...) \
> + (fwnode_has_op(fwnode, op) ? \
> + (fwnode)->ops->op(fwnode, ## __VA_ARGS__) : false)
> +
> #define fwnode_call_ptr_op(fwnode, op, ...) \
> (fwnode_has_op(fwnode, op) ? \
> (fwnode)->ops->op(fwnode, ## __VA_ARGS__) : NULL)
>
Applied, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-08-28 9:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-23 20:32 [PATCH v1] device property: Remove duplicate test for NULL Andy Shevchenko
2019-08-26 6:52 ` Sakari Ailus
2019-08-28 9:41 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).