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:	Thu, 19 Mar 2009 16:07:50 +1100
From:	Michael Ellerman <michael@...erman.id.au>
To:	Grant Likely <grant.likely@...retlab.ca>
Cc:	linuxppc-dev@...abs.org, netdev@...r.kernel.org,
	afleming@...escale.com, avorontsov@...mvista.com,
	davem@...emloft.net, galak@...nel.crashing.org
Subject: Re: [PATCH 1/9] of: add of_parse_phandle() helper for parsing
 phandle properties

On Wed, 2009-03-18 at 23:00 -0600, Grant Likely wrote:
> From: Grant Likely <grant.likely@...retlab.ca>
> 
> of_parse_phandle() is a helper function to read and parse a phandle
> property and return a pointer to the resulting device_node.
> 
> Signed-off-by: Grant Likely <grant.likely@...retlab.ca>
> ---
> 
>  drivers/of/base.c  |   23 +++++++++++++++++++++++
>  include/linux/of.h |    3 +++
>  2 files changed, 26 insertions(+), 0 deletions(-)
> 
> 
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index cd17092..1eaada4 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -494,6 +494,29 @@ int of_modalias_node(struct device_node *node, char *modalias, int len)
>  EXPORT_SYMBOL_GPL(of_modalias_node);
>  
>  /**
> + * of_parse_phandle - Resolve a phandle property to a device_node pointer
> + * @np: Pointer to device node holding phandle property
> + * @phandle_name: Name of property holding a phandle value
> + * @index: For properties holding a table of phandles, this is the index into
> + *         the table
> + *
> + * Returns the device_node pointer pointed to by the phandle, or NULL
> + */

I think it would good to follow the convention of many of the other of_
routines and have an explicit comment about the refcounting, eg:

 *      Returns a node pointer with refcount incremented, use
 *      of_node_put() on it when done.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

Download attachment "signature.asc" of type "application/pgp-signature" (198 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ