dri-devel Archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm: drm_of.c: Using EXPORT_SYMBOL_GPL instead of EXPORT_SYMBOL
@ 2024-04-29 17:35 Sui Jingfeng
  2024-04-30  9:26 ` Maxime Ripard
  0 siblings, 1 reply; 3+ messages in thread
From: Sui Jingfeng @ 2024-04-29 17:35 UTC (permalink / raw
  To: Maarten Lankhorst
  Cc: Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	dri-devel, linux-kernel, Sui Jingfeng

Linux kernel puts strict limits on which functions and data structures
are available to loadable kernel modules; only those that have been
explicitly exported with EXPORT_SYMBOL() or EXPORT_SYMBOL_GPL() are
accessible. In the case of EXPORT_SYMBOL_GPL(), only modules that declare
a GPL-compatible license will be able to see the symbol.

Since the whole drm_of.c file is declared with GPL-2.0-only license, so
let us keep functions in that source file consistently.

Signed-off-by: Sui Jingfeng <sui.jingfeng@linux.dev>
---
 drivers/gpu/drm/drm_of.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c
index 177b600895d3..1ca36d654e61 100644
--- a/drivers/gpu/drm/drm_of.c
+++ b/drivers/gpu/drm/drm_of.c
@@ -44,7 +44,7 @@ uint32_t drm_of_crtc_port_mask(struct drm_device *dev,
 
 	return 0;
 }
-EXPORT_SYMBOL(drm_of_crtc_port_mask);
+EXPORT_SYMBOL_GPL(drm_of_crtc_port_mask);
 
 /**
  * drm_of_find_possible_crtcs - find the possible CRTCs for an encoder port
@@ -77,7 +77,7 @@ uint32_t drm_of_find_possible_crtcs(struct drm_device *dev,
 
 	return possible_crtcs;
 }
-EXPORT_SYMBOL(drm_of_find_possible_crtcs);
+EXPORT_SYMBOL_GPL(drm_of_find_possible_crtcs);
 
 /**
  * drm_of_component_match_add - Add a component helper OF node match rule
@@ -181,7 +181,7 @@ int drm_of_component_probe(struct device *dev,
 
 	return component_master_add_with_match(dev, m_ops, match);
 }
-EXPORT_SYMBOL(drm_of_component_probe);
+EXPORT_SYMBOL_GPL(drm_of_component_probe);
 
 /*
  * drm_of_encoder_active_endpoint - return the active encoder endpoint
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm: drm_of.c: Using EXPORT_SYMBOL_GPL instead of EXPORT_SYMBOL
  2024-04-29 17:35 [PATCH] drm: drm_of.c: Using EXPORT_SYMBOL_GPL instead of EXPORT_SYMBOL Sui Jingfeng
@ 2024-04-30  9:26 ` Maxime Ripard
  2024-04-30 17:13   ` Sui Jingfeng
  0 siblings, 1 reply; 3+ messages in thread
From: Maxime Ripard @ 2024-04-30  9:26 UTC (permalink / raw
  To: Sui Jingfeng
  Cc: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Daniel Vetter,
	dri-devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 922 bytes --]

Hi,

On Tue, Apr 30, 2024 at 01:35:21AM +0800, Sui Jingfeng wrote:
> Linux kernel puts strict limits on which functions and data structures
> are available to loadable kernel modules; only those that have been
> explicitly exported with EXPORT_SYMBOL() or EXPORT_SYMBOL_GPL() are
> accessible. In the case of EXPORT_SYMBOL_GPL(), only modules that declare
> a GPL-compatible license will be able to see the symbol.
> 
> Since the whole drm_of.c file is declared with GPL-2.0-only license, so
> let us keep functions in that source file consistently.

You're conflating two things: the license of the code itself (GPL2
here), and the license of the users of the symbols exported in that
file (anything).

There's no relationship between the two, and you have to make an
argument for changing the latter other than just because the license is
GPL because, again, those are two different things.

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm: drm_of.c: Using EXPORT_SYMBOL_GPL instead of EXPORT_SYMBOL
  2024-04-30  9:26 ` Maxime Ripard
@ 2024-04-30 17:13   ` Sui Jingfeng
  0 siblings, 0 replies; 3+ messages in thread
From: Sui Jingfeng @ 2024-04-30 17:13 UTC (permalink / raw
  To: Maxime Ripard
  Cc: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Daniel Vetter,
	dri-devel, linux-kernel

Hi,


On 2024/4/30 17:26, Maxime Ripard wrote:
> Hi,
>
> On Tue, Apr 30, 2024 at 01:35:21AM +0800, Sui Jingfeng wrote:
>> Linux kernel puts strict limits on which functions and data structures
>> are available to loadable kernel modules; only those that have been
>> explicitly exported with EXPORT_SYMBOL() or EXPORT_SYMBOL_GPL() are
>> accessible. In the case of EXPORT_SYMBOL_GPL(), only modules that declare
>> a GPL-compatible license will be able to see the symbol.
>>
>> Since the whole drm_of.c file is declared with GPL-2.0-only license, so
>> let us keep functions in that source file consistently.
> You're conflating two things: the license of the code itself (GPL2
> here), and the license of the users of the symbols exported in that
> file (anything).
>
> There's no relationship between the two, and you have to make an
> argument for changing the latter other than just because the license is
> GPL because, again, those are two different things.

Yeah, I think you might be correct.

It seems that it is valid to have EXPORT_SYMBOL() in GPL-2.0-only licensed file.


> Maxime

-- 
Best regards,
Sui


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-04-30 17:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-29 17:35 [PATCH] drm: drm_of.c: Using EXPORT_SYMBOL_GPL instead of EXPORT_SYMBOL Sui Jingfeng
2024-04-30  9:26 ` Maxime Ripard
2024-04-30 17:13   ` Sui Jingfeng

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 read-only IMAP folder(s) and NNTP newsgroup(s).