Re: [PATCH v1 1/1] device property: Unify access to of_node

From: Andy Shevchenko
Date: Fri Jun 04 2021 - 11:56:04 EST


On Fri, Jun 04, 2021 at 10:55:05PM +0800, kernel test robot wrote:
> Hi Andy,
>
> I love your patch! Perhaps something to improve:

Definitely. Thanks for report!

> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
>
> All warnings (new ones prefixed by >>):
>
> drivers/base/property.c: In function 'device_dma_supported':
> >> drivers/base/property.c:875:48: warning: passing argument 1 of 'to_acpi_device_node' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
> 875 | return acpi_dma_supported(to_acpi_device_node(fwnode));
> | ^~~~~~
> In file included from drivers/base/property.c:10:
> include/linux/acpi.h:768:77: note: expected 'struct fwnode_handle *' but argument is of type 'const struct fwnode_handle *'
> 768 | static inline struct acpi_device *to_acpi_device_node(struct fwnode_handle *fwnode)
> | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~
> drivers/base/property.c: In function 'device_get_dma_attr':
> drivers/base/property.c:890:48: warning: passing argument 1 of 'to_acpi_device_node' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
> 890 | attr = acpi_get_dma_attr(to_acpi_device_node(fwnode));
> | ^~~~~~
> In file included from drivers/base/property.c:10:
> include/linux/acpi.h:768:77: note: expected 'struct fwnode_handle *' but argument is of type 'const struct fwnode_handle *'
> 768 | static inline struct acpi_device *to_acpi_device_node(struct fwnode_handle *fwnode)
> | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~



--
With Best Regards,
Andy Shevchenko