mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
module: Convert symbol namespace to string literal
Clean up the existing export namespace code along the same lines of
commit 33def8498f ("treewide: Convert macro and uses of __section(foo)
to __section("foo")") and for the same reason, it is not desired for the
namespace argument to be a macro expansion itself.
Scripted using
git grep -l -e MODULE_IMPORT_NS -e EXPORT_SYMBOL_NS | while read file;
do
awk -i inplace '
/^#define EXPORT_SYMBOL_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/^#define MODULE_IMPORT_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/MODULE_IMPORT_NS/ {
$0 = gensub(/MODULE_IMPORT_NS\(([^)]*)\)/, "MODULE_IMPORT_NS(\"\\1\")", "g");
}
/EXPORT_SYMBOL_NS/ {
if ($0 ~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+),/) {
if ($0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/ &&
$0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(\)/ &&
$0 !~ /^my/) {
getline line;
gsub(/[[:space:]]*\\$/, "");
gsub(/[[:space:]]/, "", line);
$0 = $0 " " line;
}
$0 = gensub(/(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/,
"\\1(\\2, \"\\3\")", "g");
}
}
{ print }' $file;
done
Requested-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://mail.google.com/mail/u/2/#inbox/FMfcgzQXKWgMmjdFwwdsfgxzKpVHWPlc
Acked-by: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
e70140ba0d
commit
cdd30ebb1b
@@ -161,7 +161,7 @@ int idxd_wq_alloc_resources(struct idxd_wq *wq)
|
||||
free_hw_descs(wq);
|
||||
return rc;
|
||||
}
|
||||
EXPORT_SYMBOL_NS_GPL(idxd_wq_alloc_resources, IDXD);
|
||||
EXPORT_SYMBOL_NS_GPL(idxd_wq_alloc_resources, "IDXD");
|
||||
|
||||
void idxd_wq_free_resources(struct idxd_wq *wq)
|
||||
{
|
||||
@@ -175,7 +175,7 @@ void idxd_wq_free_resources(struct idxd_wq *wq)
|
||||
dma_free_coherent(dev, wq->compls_size, wq->compls, wq->compls_addr);
|
||||
sbitmap_queue_free(&wq->sbq);
|
||||
}
|
||||
EXPORT_SYMBOL_NS_GPL(idxd_wq_free_resources, IDXD);
|
||||
EXPORT_SYMBOL_NS_GPL(idxd_wq_free_resources, "IDXD");
|
||||
|
||||
int idxd_wq_enable(struct idxd_wq *wq)
|
||||
{
|
||||
@@ -407,7 +407,7 @@ int idxd_wq_init_percpu_ref(struct idxd_wq *wq)
|
||||
reinit_completion(&wq->wq_resurrect);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_NS_GPL(idxd_wq_init_percpu_ref, IDXD);
|
||||
EXPORT_SYMBOL_NS_GPL(idxd_wq_init_percpu_ref, "IDXD");
|
||||
|
||||
void __idxd_wq_quiesce(struct idxd_wq *wq)
|
||||
{
|
||||
@@ -417,7 +417,7 @@ void __idxd_wq_quiesce(struct idxd_wq *wq)
|
||||
complete_all(&wq->wq_resurrect);
|
||||
wait_for_completion(&wq->wq_dead);
|
||||
}
|
||||
EXPORT_SYMBOL_NS_GPL(__idxd_wq_quiesce, IDXD);
|
||||
EXPORT_SYMBOL_NS_GPL(__idxd_wq_quiesce, "IDXD");
|
||||
|
||||
void idxd_wq_quiesce(struct idxd_wq *wq)
|
||||
{
|
||||
@@ -425,7 +425,7 @@ void idxd_wq_quiesce(struct idxd_wq *wq)
|
||||
__idxd_wq_quiesce(wq);
|
||||
mutex_unlock(&wq->wq_lock);
|
||||
}
|
||||
EXPORT_SYMBOL_NS_GPL(idxd_wq_quiesce, IDXD);
|
||||
EXPORT_SYMBOL_NS_GPL(idxd_wq_quiesce, "IDXD");
|
||||
|
||||
/* Device control bits */
|
||||
static inline bool idxd_is_enabled(struct idxd_device *idxd)
|
||||
@@ -1494,7 +1494,7 @@ err_map_portal:
|
||||
err:
|
||||
return rc;
|
||||
}
|
||||
EXPORT_SYMBOL_NS_GPL(idxd_drv_enable_wq, IDXD);
|
||||
EXPORT_SYMBOL_NS_GPL(idxd_drv_enable_wq, "IDXD");
|
||||
|
||||
void idxd_drv_disable_wq(struct idxd_wq *wq)
|
||||
{
|
||||
@@ -1516,7 +1516,7 @@ void idxd_drv_disable_wq(struct idxd_wq *wq)
|
||||
wq->type = IDXD_WQT_NONE;
|
||||
wq->client_count = 0;
|
||||
}
|
||||
EXPORT_SYMBOL_NS_GPL(idxd_drv_disable_wq, IDXD);
|
||||
EXPORT_SYMBOL_NS_GPL(idxd_drv_disable_wq, "IDXD");
|
||||
|
||||
int idxd_device_drv_probe(struct idxd_dev *idxd_dev)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user