lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 30 Aug 2019 15:27:26 +0300
From:   Heikki Krogerus <heikki.krogerus@...ux.intel.com>
To:     Sakari Ailus <sakari.ailus@...ux.intel.com>
Cc:     Petr Mladek <pmladek@...e.com>, linux-kernel@...r.kernel.org,
        rafael@...nel.org,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        linux-acpi@...r.kernel.org, devicetree@...r.kernel.org,
        Rob Herring <robh@...nel.org>
Subject: Re: [PATCH v3 02/10] software node: Make argument to
 to_software_node const

On Thu, Aug 29, 2019 at 01:10:35PM +0300, Sakari Ailus wrote:
> to_software_node() does not need to modify the fwnode_handle it operates
> on; therefore make it const. This allows passing a const fwnode_handle to
> to_software_node().
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@...ux.intel.com>

OK by me.

Reviewed-by: Heikki Krogerus <heikki.krogerus@...ux.intel.com

> ---
>  drivers/base/swnode.c    | 4 ++--
>  include/linux/property.h | 3 ++-
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c
> index a7cb41812cfda..951e7efd47c23 100644
> --- a/drivers/base/swnode.c
> +++ b/drivers/base/swnode.c
> @@ -71,9 +71,9 @@ software_node_to_swnode(const struct software_node *node)
>  	return swnode;
>  }
>  
> -const struct software_node *to_software_node(struct fwnode_handle *fwnode)
> +const struct software_node *to_software_node(const struct fwnode_handle *fwnode)
>  {
> -	struct swnode *swnode = to_swnode(fwnode);
> +	const struct swnode *swnode = to_swnode(fwnode);
>  
>  	return swnode ? swnode->node : NULL;
>  }
> diff --git a/include/linux/property.h b/include/linux/property.h
> index 5a910ad795910..421c76e53708d 100644
> --- a/include/linux/property.h
> +++ b/include/linux/property.h
> @@ -418,7 +418,8 @@ struct software_node {
>  };
>  
>  bool is_software_node(const struct fwnode_handle *fwnode);
> -const struct software_node *to_software_node(struct fwnode_handle *fwnode);
> +const struct software_node *
> +to_software_node(const struct fwnode_handle *fwnode);
>  struct fwnode_handle *software_node_fwnode(const struct software_node *node);
>  
>  int software_node_register_nodes(const struct software_node *nodes);
> -- 
> 2.20.1

thanks,

-- 
heikki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ