Skip to content

Commit 6d3c3ca

Browse files
tehcasterbrauner
authored andcommitted
module: Rename EXPORT_SYMBOL_GPL_FOR_MODULES to EXPORT_SYMBOL_FOR_MODULES
Christoph suggested that the explicit _GPL_ can be dropped from the module namespace export macro, as it's intended for in-tree modules only. It would be possible to restrict it technically, but it was pointed out [2] that some cases of using an out-of-tree build of an in-tree module with the same name are legitimate. But in that case those also have to be GPL anyway so it's unnecessary to spell it out in the macro name. Link: https://lore.kernel.org/all/[email protected]/ [1] Link: https://lore.kernel.org/all/CAK7LNATRkZHwJGpojCnvdiaoDnP%[email protected]/ [2] Suggested-by: Christoph Hellwig <[email protected]> Reviewed-by: Shivank Garg <[email protected]> Acked-by: David Hildenbrand <[email protected]> Acked-by: Nicolas Schier <[email protected]> Reviewed-by: Daniel Gomez <[email protected]> Reviewed-by: Christian Brauner <[email protected]> Signed-off-by: Vlastimil Babka <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent 593d9e4 commit 6d3c3ca

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

Documentation/core-api/symbol-namespaces.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,21 @@ unit as preprocessor statement. The above example would then read::
7676
within the corresponding compilation unit before the #include for
7777
<linux/export.h>. Typically it's placed before the first #include statement.
7878

79-
Using the EXPORT_SYMBOL_GPL_FOR_MODULES() macro
80-
-----------------------------------------------
79+
Using the EXPORT_SYMBOL_FOR_MODULES() macro
80+
-------------------------------------------
8181

8282
Symbols exported using this macro are put into a module namespace. This
83-
namespace cannot be imported.
83+
namespace cannot be imported. These exports are GPL-only as they are only
84+
intended for in-tree modules.
8485

8586
The macro takes a comma separated list of module names, allowing only those
8687
modules to access this symbol. Simple tail-globs are supported.
8788

8889
For example::
8990

90-
EXPORT_SYMBOL_GPL_FOR_MODULES(preempt_notifier_inc, "kvm,kvm-*")
91+
EXPORT_SYMBOL_FOR_MODULES(preempt_notifier_inc, "kvm,kvm-*")
9192

92-
will limit usage of this symbol to modules whoes name matches the given
93+
will limit usage of this symbol to modules whose name matches the given
9394
patterns.
9495

9596
How to use Symbols exported in Namespaces

drivers/tty/serial/8250/8250_rsa.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ void rsa_enable(struct uart_8250_port *up)
147147
if (up->port.uartclk == SERIAL_RSA_BAUD_BASE * 16)
148148
serial_out(up, UART_RSA_FRR, 0);
149149
}
150-
EXPORT_SYMBOL_GPL_FOR_MODULES(rsa_enable, "8250_base");
150+
EXPORT_SYMBOL_FOR_MODULES(rsa_enable, "8250_base");
151151

152152
/*
153153
* Attempts to turn off the RSA FIFO and resets the RSA board back to 115kbps compat mode. It is
@@ -179,7 +179,7 @@ void rsa_disable(struct uart_8250_port *up)
179179
up->port.uartclk = SERIAL_RSA_BAUD_BASE_LO * 16;
180180
uart_port_unlock_irq(&up->port);
181181
}
182-
EXPORT_SYMBOL_GPL_FOR_MODULES(rsa_disable, "8250_base");
182+
EXPORT_SYMBOL_FOR_MODULES(rsa_disable, "8250_base");
183183

184184
void rsa_autoconfig(struct uart_8250_port *up)
185185
{
@@ -192,7 +192,7 @@ void rsa_autoconfig(struct uart_8250_port *up)
192192
if (__rsa_enable(up))
193193
up->port.type = PORT_RSA;
194194
}
195-
EXPORT_SYMBOL_GPL_FOR_MODULES(rsa_autoconfig, "8250_base");
195+
EXPORT_SYMBOL_FOR_MODULES(rsa_autoconfig, "8250_base");
196196

197197
void rsa_reset(struct uart_8250_port *up)
198198
{
@@ -201,7 +201,7 @@ void rsa_reset(struct uart_8250_port *up)
201201

202202
serial_out(up, UART_RSA_FRR, 0);
203203
}
204-
EXPORT_SYMBOL_GPL_FOR_MODULES(rsa_reset, "8250_base");
204+
EXPORT_SYMBOL_FOR_MODULES(rsa_reset, "8250_base");
205205

206206
#ifdef CONFIG_SERIAL_8250_DEPRECATED_OPTIONS
207207
#ifndef MODULE

fs/anon_inodes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ struct inode *anon_inode_make_secure_inode(struct super_block *sb, const char *n
129129
}
130130
return inode;
131131
}
132-
EXPORT_SYMBOL_GPL_FOR_MODULES(anon_inode_make_secure_inode, "kvm");
132+
EXPORT_SYMBOL_FOR_MODULES(anon_inode_make_secure_inode, "kvm");
133133

134134
static struct file *__anon_inode_getfile(const char *name,
135135
const struct file_operations *fops,

include/linux/export.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,6 @@
9191
#define EXPORT_SYMBOL_NS(sym, ns) __EXPORT_SYMBOL(sym, "", ns)
9292
#define EXPORT_SYMBOL_NS_GPL(sym, ns) __EXPORT_SYMBOL(sym, "GPL", ns)
9393

94-
#define EXPORT_SYMBOL_GPL_FOR_MODULES(sym, mods) __EXPORT_SYMBOL(sym, "GPL", "module:" mods)
94+
#define EXPORT_SYMBOL_FOR_MODULES(sym, mods) __EXPORT_SYMBOL(sym, "GPL", "module:" mods)
9595

9696
#endif /* _LINUX_EXPORT_H */

0 commit comments

Comments
 (0)