From: Sakari Ailus Date: Fri, 21 Jul 2017 11:39:30 +0000 (+0300) Subject: ACPI: Use IS_ERR_OR_NULL() instead of non-NULL check in is_acpi_data_node() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b81b729164445cd94c4dd6fc4d6f10487434df4a;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ACPI: Use IS_ERR_OR_NULL() instead of non-NULL check in is_acpi_data_node() The is_acpi_data_node() function takes a struct fwnode_handle pointer as its argument. The validity of the pointer is first checked. Extend the check to cover error values as is done by similar is_acpi_node() and is_acpi_device_node() functions. Signed-off-by: Sakari Ailus Reviewed-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki --- diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 68bc6be447fd..7569123475b3 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -414,7 +414,7 @@ static inline struct acpi_device *to_acpi_device_node(struct fwnode_handle *fwno static inline bool is_acpi_data_node(struct fwnode_handle *fwnode) { - return fwnode && fwnode->type == FWNODE_ACPI_DATA; + return !IS_ERR_OR_NULL(fwnode) && fwnode->type == FWNODE_ACPI_DATA; } static inline struct acpi_data_node *to_acpi_data_node(struct fwnode_handle *fwnode)