From: Yang Shen <shenyang39@huawei.com>
To: <herbert@gondor.apana.org.au>, <davem@davemloft.net>
Cc: <linux-kernel@vger.kernel.org>, <linux-crypto@vger.kernel.org>,
<gregkh@linuxfoundation.org>
Subject: [RFC PATCH 1/6] moduleparams: Add hexulong type parameter
Date: Mon, 19 Sep 2022 20:05:32 +0800 [thread overview]
Message-ID: <20220919120537.39258-2-shenyang39@huawei.com> (raw)
In-Reply-To: <20220919120537.39258-1-shenyang39@huawei.com>
Due to the bitmap.h uses a unsigned long pointer for bitmap variable,
Add an 'hexulong' is more convenient.
Signed-off-by: Yang Shen <shenyang39@huawei.com>
---
include/linux/moduleparam.h | 7 ++++++-
kernel/params.c | 1 +
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index 962cd41a2cb5..9e0828fa3946 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -118,7 +118,7 @@ struct kparam_array
* you can create your own by defining those variables.
*
* Standard types are:
- * byte, hexint, short, ushort, int, uint, long, ulong
+ * byte, hexint, hexulong, short, ushort, int, uint, long, ulong
* charp: a character pointer
* bool: a bool, values 0/1, y/n, Y/N.
* invbool: the above, only sense-reversed (N = true).
@@ -455,6 +455,11 @@ extern int param_set_hexint(const char *val, const struct kernel_param *kp);
extern int param_get_hexint(char *buffer, const struct kernel_param *kp);
#define param_check_hexint(name, p) param_check_uint(name, p)
+extern const struct kernel_param_ops param_ops_hexulong;
+extern int param_set_hexulong(const char *val, const struct kernel_param *kp);
+extern int param_get_hexulong(char *buffer, const struct kernel_param *kp);
+#define param_check_hexulong(name, p) param_check_ulong(name, p)
+
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);
diff --git a/kernel/params.c b/kernel/params.c
index 5b92310425c5..f367f0c1f228 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -242,6 +242,7 @@ STANDARD_PARAM_DEF(long, long, "%li", kstrtol);
STANDARD_PARAM_DEF(ulong, unsigned long, "%lu", kstrtoul);
STANDARD_PARAM_DEF(ullong, unsigned long long, "%llu", kstrtoull);
STANDARD_PARAM_DEF(hexint, unsigned int, "%#08x", kstrtouint);
+STANDARD_PARAM_DEF(hexulong, unsigned long, "%#016lx", kstrtoul);
int param_set_uint_minmax(const char *val, const struct kernel_param *kp,
unsigned int min, unsigned int max)
--
2.24.0
next prev parent reply other threads:[~2022-09-19 12:08 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-19 12:05 [RFC PATCH 0/6] crypto: benchmark - add the crypto benchmark Yang Shen
2022-09-19 12:05 ` Yang Shen [this message]
2022-09-19 12:05 ` [RFC PATCH 2/6] crypto: benchmark - add a crypto benchmark tool Yang Shen
2022-09-20 7:31 ` Greg KH
2022-09-21 8:20 ` Yang Shen
2022-09-19 12:05 ` [RFC PATCH 3/6] crytpo: benchmark - support compression/decompresssion Yang Shen
2022-09-19 12:05 ` [RFC PATCH 4/6] crypto: benchmark - add help information Yang Shen
2022-09-19 12:05 ` [RFC PATCH 5/6] crypto: benchmark - add API documentation Yang Shen
2022-09-19 12:05 ` [RFC PATCH 6/6] MAINTAINERS: add crypto benchmark MAINTAINER Yang Shen
2022-09-20 8:28 ` [RFC PATCH 0/6] crypto: benchmark - add the crypto benchmark Herbert Xu
2022-09-21 8:19 ` Yang Shen
2022-09-30 4:51 ` Herbert Xu
2022-10-14 1:43 ` Yang Shen
2022-10-14 8:25 ` Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220919120537.39258-2-shenyang39@huawei.com \
--to=shenyang39@huawei.com \
--cc=davem@davemloft.net \
--cc=gregkh@linuxfoundation.org \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox