linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@samba.org>
To: Nathan Fontenot <nfont@austin.ibm.com>
Cc: linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] Kernel DLPAR infrastructure
Date: Wed, 25 Nov 2009 14:16:59 +1100	[thread overview]
Message-ID: <19212.41387.37749.652776@cargo.ozlabs.ibm.com> (raw)
In-Reply-To: <4B0C8CE3.4010207@austin.ibm.com>

Nathan Fontenot writes:

> This patch provides the kernel DLPAR infrastructure in a new filed named
> dlpar.c.  The functionality provided is for acquiring and releasing a resource
> from firmware and the parsing of information returned from the
> ibm,configure-connector rtas call.  Additionally this exports the pSeries
> reconfiguration notifier chain so that it can be invoked when device tree 
> updates are made.

Mostly looks great.

> +static struct device_node *derive_parent(const char *path)
> +{
> +	struct device_node *parent;
> +	char parent_path[128];
> +	int parent_path_len;
> +
> +	parent_path_len = strrchr(path, '/') - path + 1;
> +	strlcpy(parent_path, path, parent_path_len);

This looks a bit fragile if path could possibly not contain any '/' or
if the '/' is more than 128 characters from the start of path.  Please
fix this to check if strrchr returns NULL and to cope in some
reasonable fashion if the path happens to be very long.

> +#ifdef CONFIG_PROC_DEVICETREE
> +	ent = proc_mkdir(strrchr(dn->full_name, '/') + 1, dn->parent->pde);
> +	if (ent)
> +		proc_device_tree_add_node(dn, ent);

Also assumes that dn->full_name contains a '/'.  If for some reason it
couldn't possibly not contain a '/', put in a comment explaining that.

Thanks,
Paul.

  parent reply	other threads:[~2009-11-25  3:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-25  1:41 [PATCH 0/3] Kernel handling of Dynamic Logical Partitioning Nathan Fontenot
2009-11-25  1:48 ` [PATCH 1/3] Kernel DLPAR infrastructure Nathan Fontenot
2009-11-25  2:15   ` Michael Neuling
2009-11-25  3:03     ` Michael Neuling
2009-11-25  3:16   ` Paul Mackerras [this message]
2009-11-25  1:49 ` [PATCH 2/3] sysfs cpu probe/release files Nathan Fontenot
2009-11-25  3:20   ` Paul Mackerras
2009-11-25  1:53 ` [PATCH 3/3] CPU DLPAR handling Nathan Fontenot
2009-11-25  3:22   ` Paul Mackerras
2009-11-25  3:12 ` [PATCH 0/3] Kernel handling of Dynamic Logical Partitioning Paul Mackerras
2009-11-25  7:07   ` Nathan Fontenot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19212.41387.37749.652776@cargo.ozlabs.ibm.com \
    --to=paulus@samba.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=nfont@austin.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).