diff mbox

powerpc: Fix inconsistent of_node_to_nid EXPORT_SYMBOL handling

Message ID 1485989562-16741-1-git-send-email-shailendras@nvidia.com (mailing list archive)
State Accepted
Headers show

Commit Message

Shailendra Singh Feb. 1, 2017, 10:52 p.m. UTC
The generic implementation of of_node_to_nid is EXPORT_SYMBOL.

The powerpc implementation added by following commit is EXPORT_SYMBOL_GPL.
commit 953039c8df7b ("[PATCH] powerpc: Allow devices to register with numa
topology")

This creates an inconsistency for of_node_to_nid callers across
architectures.

Update the powerpc implementation to be exported consistently with the
generic implementation.

Signed-off-by: Shailendra Singh <shailendras@nvidia.com>

Reviewed-by: Andy Ritger <aritger@nvidia.com>
---
 arch/powerpc/mm/numa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Ellerman Feb. 9, 2017, 12:18 p.m. UTC | #1
Shailendra Singh <shailendras@nvidia.com> writes:

> The generic implementation of of_node_to_nid is EXPORT_SYMBOL.

True. Added in 298535c00a2c, in April 2016.

> The powerpc implementation added by following commit is EXPORT_SYMBOL_GPL.
> commit 953039c8df7b ("[PATCH] powerpc: Allow devices to register with numa
> topology")

Which was merged in May 2006.

So the powerpc version has almost 10 years precedence.

> This creates an inconsistency for of_node_to_nid callers across
> architectures.
>
> Update the powerpc implementation to be exported consistently with the
> generic implementation.

But I guess it's a pretty boring API. So I'll merge this unless anyone
else objects.

cheers


> Signed-off-by: Shailendra Singh <shailendras@nvidia.com>
> Reviewed-by: Andy Ritger <aritger@nvidia.com>
> ---
>  arch/powerpc/mm/numa.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
> index b1099cb2f393..8aa4ca3c84c9 100644
> --- a/arch/powerpc/mm/numa.c
> +++ b/arch/powerpc/mm/numa.c
> @@ -290,7 +290,7 @@ int of_node_to_nid(struct device_node *device)
>  
>  	return nid;
>  }
> -EXPORT_SYMBOL_GPL(of_node_to_nid);
> +EXPORT_SYMBOL(of_node_to_nid);
>  
>  static int __init find_min_common_depth(void)
>  {
> -- 
> 2.4.11
Shailendra Singh Feb. 9, 2017, 9:15 p.m. UTC | #2
Hi Michael,

>>>Which was merged in May 2006. So the powerpc version has almost 10 years precedence.

 Agreed but keeping the licensing consistent will help drivers making seamless use of it on all architectures.

>>> But I guess it's a pretty boring API. So I'll merge this unless anyone else objects.
Thanks. Appreciate your quick response and help.

Thanks,
Shailendra

-----Original Message-----
From: Michael Ellerman [mailto:mpe@ellerman.id.au] 
Sent: Thursday, February 09, 2017 4:19 AM
To: Shailendra Singh <shailendras@nvidia.com>; linuxppc-dev@lists.ozlabs.org
Cc: jk@ozlabs.org; apopple@au1.ibm.com; balbirs@au1.ibm.com; Andy Ritger <ARitger@nvidia.com>; John Hubbard <jhubbard@nvidia.com>; Sherry Cheung <SCheung@nvidia.com>; Aruna Manjunatha <amanjunatha@nvidia.com>; John McKenna <jmckenna@nvidia.com>; david.daney@cavium.com; robh@kernel.org; will.deacon@arm.com; Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH] powerpc: Fix inconsistent of_node_to_nid EXPORT_SYMBOL handling

Shailendra Singh <shailendras@nvidia.com> writes:

> The generic implementation of of_node_to_nid is EXPORT_SYMBOL.

True. Added in 298535c00a2c, in April 2016.

> The powerpc implementation added by following commit is EXPORT_SYMBOL_GPL.
> commit 953039c8df7b ("[PATCH] powerpc: Allow devices to register with 
> numa
> topology")

Which was merged in May 2006.

So the powerpc version has almost 10 years precedence.
[Shailendra] - Agreed. Keeping the licensing consistent will help drivers making use of it on all architectures.

> This creates an inconsistency for of_node_to_nid callers across 
> architectures.
>
> Update the powerpc implementation to be exported consistently with the 
> generic implementation.

But I guess it's a pretty boring API. So I'll merge this unless anyone else objects.
[Shailendra] - Thanks. Appreciate your quick response.

cheers


> Signed-off-by: Shailendra Singh <shailendras@nvidia.com>
> Reviewed-by: Andy Ritger <aritger@nvidia.com>
> ---
>  arch/powerpc/mm/numa.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 
> b1099cb2f393..8aa4ca3c84c9 100644
> --- a/arch/powerpc/mm/numa.c
> +++ b/arch/powerpc/mm/numa.c
> @@ -290,7 +290,7 @@ int of_node_to_nid(struct device_node *device)
>  
>  	return nid;
>  }
> -EXPORT_SYMBOL_GPL(of_node_to_nid);
> +EXPORT_SYMBOL(of_node_to_nid);
>  
>  static int __init find_min_common_depth(void)  {
> --
> 2.4.11
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
Michael Ellerman Feb. 14, 2017, 12:40 p.m. UTC | #3
On Wed, 2017-02-01 at 22:52:42 UTC, Shailendra Singh wrote:
> The generic implementation of of_node_to_nid is EXPORT_SYMBOL.
> 
> The powerpc implementation added by following commit is EXPORT_SYMBOL_GPL.
> commit 953039c8df7b ("[PATCH] powerpc: Allow devices to register with numa
> topology")
> 
> This creates an inconsistency for of_node_to_nid callers across
> architectures.
> 
> Update the powerpc implementation to be exported consistently with the
> generic implementation.
> 
> Signed-off-by: Shailendra Singh <shailendras@nvidia.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/be9ba9ff93cc3e44dc46da9ed25655

cheers
diff mbox

Patch

diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index b1099cb2f393..8aa4ca3c84c9 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -290,7 +290,7 @@  int of_node_to_nid(struct device_node *device)
 
 	return nid;
 }
-EXPORT_SYMBOL_GPL(of_node_to_nid);
+EXPORT_SYMBOL(of_node_to_nid);
 
 static int __init find_min_common_depth(void)
 {