Skip to content

Commit

Permalink
ACPI: Use IS_ERR_OR_NULL() instead of non-NULL check in is_acpi_data_…
Browse files Browse the repository at this point in the history
…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 <sakari.ailus@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Sakari Ailus authored and Rafael J. Wysocki committed Jul 21, 2017
1 parent 5771a8c commit b81b729
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/acpi/acpi_bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b81b729

Please sign in to comment.