From: Grant Likely <grant.likely@linaro.org>
To: Nathan Fontenot <nfont@linux.vnet.ibm.com>,
Benjamin Herrenschmidt <benh@kernel.crashing.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\r notifiers
Date: Wed, 26 Nov 2014 13:16:34 +0000 [thread overview]
Message-ID: <20141126131634.63DB7C4099B@trevor.secretlab.ca> (raw)
In-Reply-To: <547544FE.5020706@linux.vnet.ibm.com>
On Tue, 25 Nov 2014 21:11:58 -0600
, Nathan Fontenot <nfont@linux.vnet.ibm.com>
wrote:
> 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.
Agreed. I'm going to merge it as-is.
g.
next prev parent reply other threads:[~2014-11-26 13:16 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-24 22:33 [PATCH v2 00/14] of: DT Overlay patches to be merged Grant Likely
2014-11-24 22:33 ` [PATCH v2 01/14] of: Use vargs in __of_node_alloc Grant Likely
2014-11-24 22:33 ` [PATCH v2 02/14] of: Refactor __of_node_alloc() into __of_node_dup() Grant Likely
2014-11-24 22:33 ` [PATCH v2 03/14] of/resolver: Switch to new local fixups format Grant Likely
2014-11-24 22:33 ` [PATCH v2 04/14] of/reconfig: Add of_reconfig_get_state_change() of notifier helper Grant Likely
2014-11-24 22:33 ` [PATCH v2 05/14] of/reconfig: Add empty stubs for the of_reconfig methods Grant Likely
2014-11-24 22:33 ` [PATCH v2 06/14] of/reconfig: Add debug output for OF_RECONFIG notifiers Grant Likely
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
2014-11-26 13:16 ` Grant Likely [this message]
2014-11-24 22:33 ` [PATCH v2 08/14] of/reconfig: Add OF_DYNAMIC notifier for platform_bus_type Grant Likely
2014-11-24 22:33 ` [PATCH v2 09/14] of/overlay: Introduce DT overlay support Grant Likely
2014-11-24 22:33 ` [PATCH v2 10/14] of/overlay: Add overlay unittests Grant Likely
2014-11-24 22:33 ` [PATCH v2 11/14] i2c/of: Factor out Devicetree registration code Grant Likely
2014-11-25 14:11 ` Wolfram Sang
2014-11-24 22:33 ` [PATCH v2 12/14] i2c/of: Add OF_RECONFIG notifier handler Grant Likely
2014-11-25 14:11 ` Wolfram Sang
2014-11-24 22:33 ` [PATCH v2 13/14] spi/of: Create new device registration method and accessors Grant Likely
2014-11-25 11:32 ` Mark Brown
2014-11-24 22:33 ` [PATCH v2 14/14] spi/of: Add OF notifier handler Grant Likely
2014-11-25 11:44 ` Mark Brown
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=20141126131634.63DB7C4099B@trevor.secretlab.ca \
--to=grant.likely@linaro.org \
--cc=benh@kernel.crashing.org \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=nfont@linux.vnet.ibm.com \
--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
all inboxes | Powered by JetHome®