From: Nathan Fontenot <nfont@linux.vnet.ibm.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Grant Likely <grant.likely@linaro.org>
Cc: devicetree@vger.kernel.org, Wolfram Sang <wsa@the-dreams.de>,
Pantelis Antoniou <pantelis.antoniou@konsulko.com>,
linux-kernel@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
Mark Brown <broonie@kernel.org>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2 07/14] of/reconfig: Always use the same structure for notifiers
Date: Tue, 25 Nov 2014 21:11:58 -0600 [thread overview]
Message-ID: <547544FE.5020706@linux.vnet.ibm.com> (raw)
In-Reply-To: <1416956874.5089.13.camel@kernel.crashing.org>
On 11/25/2014 05:07 PM, Benjamin Herrenschmidt wrote:
> On Mon, 2014-11-24 at 22:33 +0000, Grant Likely wrote:
>> The OF_RECONFIG notifier callback uses a different structure depending
>> on whether it is a node change or a property change. This is silly, and
>> not very safe. Rework the code to use the same data structure regardless
>> of the type of notifier.
>
> I fell pretty good about this one except...
>
>> diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
>> index b9d1dfdbe5bb..9fe6002c1d5a 100644
>> --- a/arch/powerpc/mm/numa.c
>> +++ b/arch/powerpc/mm/numa.c
>> @@ -1711,12 +1711,11 @@ static void stage_topology_update(int core_id)
>> static int dt_update_callback(struct notifier_block *nb,
>> unsigned long action, void *data)
>> {
>> - struct of_prop_reconfig *update;
>> + struct of_reconfig_data *update = data;
>> int rc = NOTIFY_DONE;
>>
>> switch (action) {
>> case OF_RECONFIG_UPDATE_PROPERTY:
>> - update = (struct of_prop_reconfig *)data;
>
> Should we assert/bug on !update->dn / update->prop ?
>
> (Same for the rest of the patch)
>
> Or do you reckon it's pointless ?
>
I'm not sure it's worth it, if those are NULL pointers the drivers/of
code would have tried to use them before invoking the notifier chain.
We won't make it this far if they're NULL.
Otherwise the patch looks good to me,
Reviewed-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
-Nathan
next prev parent reply other threads:[~2014-11-26 3:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1416868422-22103-1-git-send-email-grant.likely@linaro.org>
2014-11-24 22:33 ` [PATCH v2 07/14] of/reconfig: Always use the same structure for notifiers Grant Likely
2014-11-25 23:07 ` Benjamin Herrenschmidt
2014-11-26 3:11 ` Nathan Fontenot [this message]
2014-11-26 13:16 ` Grant Likely
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=547544FE.5020706@linux.vnet.ibm.com \
--to=nfont@linux.vnet.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=grant.likely@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=pantelis.antoniou@konsulko.com \
--cc=robh+dt@kernel.org \
--cc=wsa@the-dreams.de \
/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).