[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <19212.41387.37749.652776@cargo.ozlabs.ibm.com>
Date: Wed, 25 Nov 2009 14:16:59 +1100
From: Paul Mackerras <paulus@...ba.org>
To: Nathan Fontenot <nfont@...tin.ibm.com>
Cc: linuxppc-dev@...abs.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] Kernel DLPAR infrastructure
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists