Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fs/nls: make load_nls() take a const parameter

load_nls() take a char * parameter, use it to find nls module in list or
construct the module name to load it.

This change make load_nls() take a const parameter, so we don't need do
some cast like this:

ses->local_nls = load_nls((char *)ctx->local_nls->charset);

Suggested-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Winston Wen <wentao@uniontech.com>
Reviewed-by: Paulo Alcantara <pc@manguebit.com>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>

authored by

Winston Wen and committed by
Steve French
c1ed39ec 6eaae198

+3 -3
+2 -2
fs/nls/nls_base.c
··· 272 272 return -EINVAL; 273 273 } 274 274 275 - static struct nls_table *find_nls(char *charset) 275 + static struct nls_table *find_nls(const char *charset) 276 276 { 277 277 struct nls_table *nls; 278 278 spin_lock(&nls_lock); ··· 288 288 return nls; 289 289 } 290 290 291 - struct nls_table *load_nls(char *charset) 291 + struct nls_table *load_nls(const char *charset) 292 292 { 293 293 return try_then_request_module(find_nls(charset), "nls_%s", charset); 294 294 }
+1 -1
include/linux/nls.h
··· 47 47 /* nls_base.c */ 48 48 extern int __register_nls(struct nls_table *, struct module *); 49 49 extern int unregister_nls(struct nls_table *); 50 - extern struct nls_table *load_nls(char *); 50 + extern struct nls_table *load_nls(const char *charset); 51 51 extern void unload_nls(struct nls_table *); 52 52 extern struct nls_table *load_nls_default(void); 53 53 #define register_nls(nls) __register_nls((nls), THIS_MODULE)