Skip to content

Commit c1ed39e

Browse files
winnscodesmfrench
authored andcommitted
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 <[email protected]> Signed-off-by: Winston Wen <[email protected]> Reviewed-by: Paulo Alcantara <[email protected]> Reviewed-by: Christian Brauner <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 6eaae19 commit c1ed39e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

fs/nls/nls_base.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ int unregister_nls(struct nls_table * nls)
272272
return -EINVAL;
273273
}
274274

275-
static struct nls_table *find_nls(char *charset)
275+
static struct nls_table *find_nls(const char *charset)
276276
{
277277
struct nls_table *nls;
278278
spin_lock(&nls_lock);
@@ -288,7 +288,7 @@ static struct nls_table *find_nls(char *charset)
288288
return nls;
289289
}
290290

291-
struct nls_table *load_nls(char *charset)
291+
struct nls_table *load_nls(const char *charset)
292292
{
293293
return try_then_request_module(find_nls(charset), "nls_%s", charset);
294294
}

include/linux/nls.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ enum utf16_endian {
4747
/* nls_base.c */
4848
extern int __register_nls(struct nls_table *, struct module *);
4949
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);
5151
extern void unload_nls(struct nls_table *);
5252
extern struct nls_table *load_nls_default(void);
5353
#define register_nls(nls) __register_nls((nls), THIS_MODULE)

0 commit comments

Comments
 (0)