nls: have register_nls() set ->owner
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 22 Nov 2013 06:45:04 +0000 (01:45 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 25 Jan 2014 08:14:05 +0000 (03:14 -0500)
pass owner explicitly to __register_nls(), make register_nls() a macro passing
THIS_MODULE as the owner argument to __register_nls().

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
53 files changed:
fs/nls/mac-celtic.c
fs/nls/mac-centeuro.c
fs/nls/mac-croatian.c
fs/nls/mac-cyrillic.c
fs/nls/mac-gaelic.c
fs/nls/mac-greek.c
fs/nls/mac-iceland.c
fs/nls/mac-inuit.c
fs/nls/mac-roman.c
fs/nls/mac-romanian.c
fs/nls/mac-turkish.c
fs/nls/nls_ascii.c
fs/nls/nls_base.c
fs/nls/nls_cp1250.c
fs/nls/nls_cp1251.c
fs/nls/nls_cp1255.c
fs/nls/nls_cp437.c
fs/nls/nls_cp737.c
fs/nls/nls_cp775.c
fs/nls/nls_cp850.c
fs/nls/nls_cp852.c
fs/nls/nls_cp855.c
fs/nls/nls_cp857.c
fs/nls/nls_cp860.c
fs/nls/nls_cp861.c
fs/nls/nls_cp862.c
fs/nls/nls_cp863.c
fs/nls/nls_cp864.c
fs/nls/nls_cp865.c
fs/nls/nls_cp866.c
fs/nls/nls_cp869.c
fs/nls/nls_cp874.c
fs/nls/nls_cp932.c
fs/nls/nls_cp936.c
fs/nls/nls_cp949.c
fs/nls/nls_cp950.c
fs/nls/nls_euc-jp.c
fs/nls/nls_iso8859-1.c
fs/nls/nls_iso8859-13.c
fs/nls/nls_iso8859-14.c
fs/nls/nls_iso8859-15.c
fs/nls/nls_iso8859-2.c
fs/nls/nls_iso8859-3.c
fs/nls/nls_iso8859-4.c
fs/nls/nls_iso8859-5.c
fs/nls/nls_iso8859-6.c
fs/nls/nls_iso8859-7.c
fs/nls/nls_iso8859-9.c
fs/nls/nls_koi8-r.c
fs/nls/nls_koi8-ru.c
fs/nls/nls_koi8-u.c
fs/nls/nls_utf8.c
include/linux/nls.h

index 634a8b7..266c2d7 100644 (file)
@@ -583,7 +583,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_macceltic(void)
index 979e626..9789c60 100644 (file)
@@ -513,7 +513,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_maccenteuro(void)
index dd3f675..bb19e7a 100644 (file)
@@ -583,7 +583,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_maccroatian(void)
index 1112c84..2a7dea3 100644 (file)
@@ -478,7 +478,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_maccyrillic(void)
index 2de9158..77b0016 100644 (file)
@@ -548,7 +548,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_macgaelic(void)
index a863100..1eccf49 100644 (file)
@@ -478,7 +478,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_macgreek(void)
index babe299..cbd0875 100644 (file)
@@ -583,7 +583,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_maciceland(void)
index 312364f..fba8357 100644 (file)
@@ -513,7 +513,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_macinuit(void)
index 53ce080..b6a98a5 100644 (file)
@@ -618,7 +618,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_macroman(void)
index add6f7a..25547f0 100644 (file)
@@ -583,7 +583,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_macromanian(void)
index dffa96d..b5454bc 100644 (file)
@@ -583,7 +583,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_macturkish(void)
index 7020e94..a262065 100644 (file)
@@ -148,7 +148,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_ascii(void)
index fea6bd5..52ccd34 100644 (file)
@@ -232,13 +232,14 @@ int utf16s_to_utf8s(const wchar_t *pwcs, int inlen, enum utf16_endian endian,
 }
 EXPORT_SYMBOL(utf16s_to_utf8s);
 
-int register_nls(struct nls_table * nls)
+int __register_nls(struct nls_table *nls, struct module *owner)
 {
        struct nls_table ** tmp = &tables;
 
        if (nls->next)
                return -EBUSY;
 
+       nls->owner = owner;
        spin_lock(&nls_lock);
        while (*tmp) {
                if (nls == *tmp) {
@@ -252,6 +253,7 @@ int register_nls(struct nls_table * nls)
        spin_unlock(&nls_lock);
        return 0;       
 }
+EXPORT_SYMBOL(__register_nls);
 
 int unregister_nls(struct nls_table * nls)
 {
@@ -538,7 +540,6 @@ struct nls_table *load_nls_default(void)
                return &default_table;
 }
 
-EXPORT_SYMBOL(register_nls);
 EXPORT_SYMBOL(unregister_nls);
 EXPORT_SYMBOL(unload_nls);
 EXPORT_SYMBOL(load_nls);
index c8471fe..ace3e19 100644 (file)
@@ -329,7 +329,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_cp1250(void)
index 1939b46..9273ddf 100644 (file)
@@ -283,7 +283,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_cp1251(void)
index 8120ae2..1caf5df 100644 (file)
@@ -365,7 +365,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_cp1255(void)
index ff37a46..7ddb830 100644 (file)
@@ -369,7 +369,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_cp437(void)
index f5576b8..c593f68 100644 (file)
@@ -332,7 +332,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_cp737(void)
index 4905635..554c863 100644 (file)
@@ -301,7 +301,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_cp775(void)
index fe5bdad..56cccd1 100644 (file)
@@ -297,7 +297,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_cp850(void)
index ceb1c01..7cdc05a 100644 (file)
@@ -319,7 +319,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_cp852(void)
index cc7f5fb..7426eea 100644 (file)
@@ -281,7 +281,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_cp855(void)
index e418e19..0983097 100644 (file)
@@ -283,7 +283,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_cp857(void)
index a86c97d..8422447 100644 (file)
@@ -346,7 +346,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_cp860(void)
index bd92022..dc873e4 100644 (file)
@@ -369,7 +369,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_cp861(void)
index e9b68eb..d5263e3 100644 (file)
@@ -403,7 +403,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_cp862(void)
index f8a9b07..051c983 100644 (file)
@@ -363,7 +363,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_cp863(void)
index 8d31f43..97eb127 100644 (file)
@@ -389,7 +389,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_cp864(void)
index 4bd902f..1112142 100644 (file)
@@ -369,7 +369,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_cp865(void)
index bdc7cb3..ffdcbc3 100644 (file)
@@ -287,7 +287,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_cp866(void)
index 9f283a2..3b5a345 100644 (file)
@@ -297,7 +297,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_cp869(void)
index 0b3c488..8dfaa10 100644 (file)
@@ -256,7 +256,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_cp874(void)
index 0ffed6f..67b7398 100644 (file)
@@ -7914,7 +7914,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_cp932(void)
index 8277030..c96546c 100644 (file)
@@ -11092,7 +11092,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_cp936(void)
index 8a7a2fe..199171e 100644 (file)
@@ -13927,7 +13927,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_cp949(void)
index ef25368..8e14187 100644 (file)
@@ -9463,7 +9463,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_cp950(void)
index 7424929..162b3f1 100644 (file)
@@ -553,7 +553,6 @@ static struct nls_table table = {
        .charset        = "euc-jp",
        .uni2char       = uni2char,
        .char2uni       = char2uni,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_euc_jp(void)
index 7b951bb..69ac020 100644 (file)
@@ -239,7 +239,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_iso8859_1(void)
index c4d52ea..afb3f8f 100644 (file)
@@ -267,7 +267,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_iso8859_13(void)
index dc02600..046370f 100644 (file)
@@ -323,7 +323,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_iso8859_14(void)
index 3c7dfc8..7e34a84 100644 (file)
@@ -289,7 +289,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_iso8859_15(void)
index a2d2197..7dd5711 100644 (file)
@@ -290,7 +290,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_iso8859_2(void)
index a61e0da..740b75e 100644 (file)
@@ -290,7 +290,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_iso8859_3(void)
index e8ff555..8826021 100644 (file)
@@ -290,7 +290,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_iso8859_4(void)
index 4721e89..7c04057 100644 (file)
@@ -254,7 +254,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_iso8859_5(void)
index 01a517d..d4a8814 100644 (file)
@@ -245,7 +245,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_iso8859_6(void)
index 2d27b93..37b75d8 100644 (file)
@@ -299,7 +299,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_iso8859_7(void)
index 694bf07..557b982 100644 (file)
@@ -254,7 +254,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_iso8859_9(void)
index 4387531..811f232 100644 (file)
@@ -305,7 +305,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_koi8_r(void)
index e7bc1d7..a80a741 100644 (file)
@@ -55,7 +55,6 @@ static struct nls_table table = {
        .charset        = "koi8-ru",
        .uni2char       = uni2char,
        .char2uni       = char2uni,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_koi8_ru(void)
index 8c9f029..7e029e4 100644 (file)
@@ -312,7 +312,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = charset2lower,
        .charset2upper  = charset2upper,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_koi8_u(void)
index 0d60a44..afcfbc4 100644 (file)
@@ -46,7 +46,6 @@ static struct nls_table table = {
        .char2uni       = char2uni,
        .charset2lower  = identity,     /* no conversion */
        .charset2upper  = identity,
-       .owner          = THIS_MODULE,
 };
 
 static int __init init_nls_utf8(void)
index 5dc635f..520681b 100644 (file)
@@ -44,11 +44,12 @@ enum utf16_endian {
 };
 
 /* nls_base.c */
-extern int register_nls(struct nls_table *);
+extern int __register_nls(struct nls_table *, struct module *);
 extern int unregister_nls(struct nls_table *);
 extern struct nls_table *load_nls(char *);
 extern void unload_nls(struct nls_table *);
 extern struct nls_table *load_nls_default(void);
+#define register_nls(nls) __register_nls((nls), THIS_MODULE)
 
 extern int utf8_to_utf32(const u8 *s, int len, unicode_t *pu);
 extern int utf32_to_utf8(unicode_t u, u8 *s, int maxlen);