mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

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>
77 lines
1.8 KiB
C
77 lines
1.8 KiB
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* Routines supporting VMX instructions on the Power 8
|
|
*
|
|
* Copyright (C) 2015 International Business Machines Inc.
|
|
*
|
|
* Author: Marcelo Henrique Cerri <mhcerri@br.ibm.com>
|
|
*/
|
|
|
|
#include <linux/module.h>
|
|
#include <linux/moduleparam.h>
|
|
#include <linux/types.h>
|
|
#include <linux/err.h>
|
|
#include <linux/cpufeature.h>
|
|
#include <linux/crypto.h>
|
|
#include <asm/cputable.h>
|
|
#include <crypto/internal/hash.h>
|
|
#include <crypto/internal/skcipher.h>
|
|
|
|
#include "aesp8-ppc.h"
|
|
|
|
static int __init p8_init(void)
|
|
{
|
|
int ret;
|
|
|
|
ret = crypto_register_shash(&p8_ghash_alg);
|
|
if (ret)
|
|
goto err;
|
|
|
|
ret = crypto_register_alg(&p8_aes_alg);
|
|
if (ret)
|
|
goto err_unregister_ghash;
|
|
|
|
ret = crypto_register_skcipher(&p8_aes_cbc_alg);
|
|
if (ret)
|
|
goto err_unregister_aes;
|
|
|
|
ret = crypto_register_skcipher(&p8_aes_ctr_alg);
|
|
if (ret)
|
|
goto err_unregister_aes_cbc;
|
|
|
|
ret = crypto_register_skcipher(&p8_aes_xts_alg);
|
|
if (ret)
|
|
goto err_unregister_aes_ctr;
|
|
|
|
return 0;
|
|
|
|
err_unregister_aes_ctr:
|
|
crypto_unregister_skcipher(&p8_aes_ctr_alg);
|
|
err_unregister_aes_cbc:
|
|
crypto_unregister_skcipher(&p8_aes_cbc_alg);
|
|
err_unregister_aes:
|
|
crypto_unregister_alg(&p8_aes_alg);
|
|
err_unregister_ghash:
|
|
crypto_unregister_shash(&p8_ghash_alg);
|
|
err:
|
|
return ret;
|
|
}
|
|
|
|
static void __exit p8_exit(void)
|
|
{
|
|
crypto_unregister_skcipher(&p8_aes_xts_alg);
|
|
crypto_unregister_skcipher(&p8_aes_ctr_alg);
|
|
crypto_unregister_skcipher(&p8_aes_cbc_alg);
|
|
crypto_unregister_alg(&p8_aes_alg);
|
|
crypto_unregister_shash(&p8_ghash_alg);
|
|
}
|
|
|
|
module_cpu_feature_match(PPC_MODULE_FEATURE_VEC_CRYPTO, p8_init);
|
|
module_exit(p8_exit);
|
|
|
|
MODULE_AUTHOR("Marcelo Cerri<mhcerri@br.ibm.com>");
|
|
MODULE_DESCRIPTION("IBM VMX cryptographic acceleration instructions "
|
|
"support on Power 8");
|
|
MODULE_LICENSE("GPL");
|
|
MODULE_VERSION("1.0.0");
|
|
MODULE_IMPORT_NS("CRYPTO_INTERNAL");
|