Skip to content

Commit

Permalink
module: export param_free_charp()
Browse files Browse the repository at this point in the history
Change the param_free_charp() function from static to exported.

It is used by zswap in the next patch ("zswap: use charp for zswap param
strings").

Signed-off-by: Dan Streetman <[email protected]>
Acked-by: Rusty Russell <[email protected]>
Cc: Seth Jennings <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
ddstreet authored and torvalds committed Nov 7, 2015
1 parent b0c9865 commit 3d9c637
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/linux/moduleparam.h
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ extern int param_get_ullong(char *buffer, const struct kernel_param *kp);
extern const struct kernel_param_ops param_ops_charp;
extern int param_set_charp(const char *val, const struct kernel_param *kp);
extern int param_get_charp(char *buffer, const struct kernel_param *kp);
extern void param_free_charp(void *arg);
#define param_check_charp(name, p) __param_check(name, p, char *)

/* We used to allow int as well as bool. We're taking that away! */
Expand Down
3 changes: 2 additions & 1 deletion kernel/params.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,11 @@ int param_get_charp(char *buffer, const struct kernel_param *kp)
}
EXPORT_SYMBOL(param_get_charp);

static void param_free_charp(void *arg)
void param_free_charp(void *arg)
{
maybe_kfree_parameter(*((char **)arg));
}
EXPORT_SYMBOL(param_free_charp);

const struct kernel_param_ops param_ops_charp = {
.set = param_set_charp,
Expand Down

0 comments on commit 3d9c637

Please sign in to comment.