devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frank Rowand <frowand.list@gmail.com>
To: Rob Herring <robh@kernel.org>, devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	sparclinux@vger.kernel.org
Subject: Re: [PATCH 3/3] of: make default address and size cells sizes private
Date: Tue, 4 Sep 2018 18:55:26 -0700	[thread overview]
Message-ID: <35247ddc-303b-89d0-53b5-231c1a293721@gmail.com> (raw)
In-Reply-To: <20180830190523.31474-4-robh@kernel.org>

On 08/30/18 12:05, Rob Herring wrote:
> Only some old OpenFirmware implementations rely on default sizes. Any
> FDT and modern implementation should have explicit properties. Make the
> OF_ROOT_NODE_*_CELLS_DEFAULT defines private so we don't get any outside
> users.
> 
> This also gets us one step closer to removing the asm/prom.h dependency on
> Sparc.
> 
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Frank Rowand <frowand.list@gmail.com>
> Cc: sparclinux@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  arch/sparc/include/asm/prom.h | 3 ---
>  drivers/of/of_private.h       | 8 ++++++++
>  include/linux/of.h            | 6 ------
>  3 files changed, 8 insertions(+), 9 deletions(-)

Reviewed-by: Frank Rowand <frank.rowand@sony.com>


> diff --git a/arch/sparc/include/asm/prom.h b/arch/sparc/include/asm/prom.h
> index d955c8df62d6..1902db27ff4b 100644
> --- a/arch/sparc/include/asm/prom.h
> +++ b/arch/sparc/include/asm/prom.h
> @@ -24,9 +24,6 @@
>  #include <linux/atomic.h>
>  #include <linux/irqdomain.h>
>  
> -#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT	2
> -#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT	1
> -
>  #define of_compat_cmp(s1, s2, l)	strncmp((s1), (s2), (l))
>  #define of_prop_cmp(s1, s2)		strcasecmp((s1), (s2))
>  #define of_node_cmp(s1, s2)		strcmp((s1), (s2))
> diff --git a/drivers/of/of_private.h b/drivers/of/of_private.h
> index 216175d11d3d..5d1567025358 100644
> --- a/drivers/of/of_private.h
> +++ b/drivers/of/of_private.h
> @@ -27,6 +27,14 @@ struct alias_prop {
>  	char stem[0];
>  };
>  
> +#if defined(CONFIG_SPARC)
> +#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 2
> +#else
> +#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1
> +#endif
> +
> +#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
> +
>  extern struct mutex of_mutex;
>  extern struct list_head aliases_lookup;
>  extern struct kset *of_kset;
> diff --git a/include/linux/of.h b/include/linux/of.h
> index 506beca9588d..49d85f670c75 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -247,12 +247,6 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size)
>  #include <asm/prom.h>
>  #endif
>  
> -/* Default #address and #size cells.  Allow arch asm/prom.h to override */
> -#if !defined(OF_ROOT_NODE_ADDR_CELLS_DEFAULT)
> -#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1
> -#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
> -#endif
> -
>  #define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
>  #define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
>  
> 

  reply	other threads:[~2018-09-05  1:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-30 19:05 [PATCH 0/3] of: root #{size,address}-cells clean-ups Rob Herring
2018-08-30 19:05 ` [PATCH 1/3] of/fdt: Scan the root node properties earlier Rob Herring
2018-09-05  1:49   ` Frank Rowand
2018-09-05 11:51     ` Rob Herring
2018-09-05 18:18       ` Frank Rowand
2018-09-05 20:06         ` Rob Herring
2018-09-05 21:10           ` Frank Rowand
2018-09-05 21:31             ` Rob Herring
2018-09-06 21:03               ` Frank Rowand
2018-08-30 19:05 ` [PATCH 2/3] of/fdt: avoid re-parsing '#{address,size}-cells' in of_fdt_limit_memory Rob Herring
2018-09-01  2:41   ` kbuild test robot
2018-09-05  1:54   ` Frank Rowand
2018-08-30 19:05 ` [PATCH 3/3] of: make default address and size cells sizes private Rob Herring
2018-09-05  1:55   ` Frank Rowand [this message]
2018-09-05  4:37     ` Mark Cave-Ayland
2018-09-05 12:12       ` Rob Herring
2018-09-05 16:01         ` Mark Cave-Ayland
2018-09-05  1:56 ` [PATCH 0/3] of: root #{size,address}-cells clean-ups Frank Rowand

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=35247ddc-303b-89d0-53b5-231c1a293721@gmail.com \
    --to=frowand.list@gmail.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sparclinux@vger.kernel.org \
    /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).