public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Grant Likely <grant.likely@linaro.org>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Pantelis Antoniou <pantelis.antoniou@konsulko.com>,
	Rob Herring <robh+dt@kernel.org>, Mark Brown <broonie@kernel.org>,
	Wolfram Sang <wsa@the-dreams.de>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2 07/14] of/reconfig: Always use the same structure for notifiers
Date: Wed, 26 Nov 2014 10:07:54 +1100	[thread overview]
Message-ID: <1416956874.5089.13.camel@kernel.crashing.org> (raw)
In-Reply-To: <1416868422-22103-8-git-send-email-grant.likely@linaro.org>

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 ?

Ben.



  reply	other threads:[~2014-11-25 23:08 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 [this message]
2014-11-26  3:11     ` Nathan Fontenot
2014-11-26 13:16       ` Grant Likely
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=1416956874.5089.13.camel@kernel.crashing.org \
    --to=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