Re: [PATCH v3 1/8] ACPI: Use IS_ERR_OR_NULL() instead of non-NULL check in is_acpi_data_node

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Fri, 2017-07-21 at 14:39 +0300, Sakari Ailus wrote:
> 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.
> 

Patch is good.

It seems we will have three places with such code. Do we care to get rid
of them in favor of is_acpi_data_node()? (I didn't read whole series
yet, maybe it's already done)

Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

> Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>
> ---
>  include/acpi/acpi_bus.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
> index 68bc6be..7569123 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)

-- 
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Intel Finland Oy
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux