Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2434993rwb; Mon, 19 Sep 2022 05:13:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4vDEN9hK3ib2OeKdWfjnEvfxxrJl2Z0WlVJqqCZ/Rh8iayYfVsNppFXb4sYGT3U6SQyEDB X-Received: by 2002:aa7:d359:0:b0:454:488a:e8b2 with SMTP id m25-20020aa7d359000000b00454488ae8b2mr1046239edr.7.1663589606078; Mon, 19 Sep 2022 05:13:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663589606; cv=none; d=google.com; s=arc-20160816; b=nUifh1o6xGzdTyNAWm1sxRX/eRcEC5SZDp3Oah3JG50any0ky2PjrpNayjrB/Sp5Qh gBDE4NhzVkDD8WDYnGmLfOYKqOVsgQ5gjc64/H/sARLBkYB38raq+aJpc3/ZWnr2i5Qp qe12giu+yf8LbzVIziLpLlUpIzWInPiX9FxxEVa5ftW3wsj2bEo9pCIs2BtL0GBO9gNs Wt6YA/qiSD9Uf4nFNMjOQtjPaOT4rNsVGmsyroNpyawTlFZYVj7zDlkJKZhvYbH8JZZ/ rcigGcpwdRnUCx2O9Fl7XufBO5gOO5wvsHiAzXh7IV3IpqcAkm6qh96RspR/D0V8GiJ5 J07Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=8/I0wllJ5REYHoSrXSD7BzVv5KXZQu+rLGxGLj62BhI=; b=LLdpeE0d94YsQQrhc0Z9BSblms83okuFvI7o7+go7qk5BH1ErQQWElWzaofZn0mQEg vUNYA2j03iU1OrdpVwbxueldbbBPypxE+Y2mktRU1wSkiTbGGQYHh/TRgQ0aiIbnEKHY 0nWdKhwb05/lYvj63/eqlwSYD3/m+Xib2pT4U2AiG9T4GGVxc8Q6oi+ySTT+u4q3Rviw BsfWujabavRjWKhP9q4gWKXWNPDMYp5RiLjGc8CGD+v95a/lRLjnyFa602S0CqIay0mS 1Eca3Pfn6VZhVGcvrcGPIsLNOiP8xXJABavoIu97gSrNyv9V9hqjijqifz0jnQB/7Y8e GBqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xd1-20020a170907078100b00780b9a0ca48si9820656ejb.313.2022.09.19.05.12.53; Mon, 19 Sep 2022 05:13:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229722AbiISMIH (ORCPT + 99 others); Mon, 19 Sep 2022 08:08:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230028AbiISMIE (ORCPT ); Mon, 19 Sep 2022 08:08:04 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30C0D2A423; Mon, 19 Sep 2022 05:08:02 -0700 (PDT) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MWNd32spCzmVRF; Mon, 19 Sep 2022 20:04:07 +0800 (CST) Received: from dggpemm500005.china.huawei.com (7.185.36.74) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 19 Sep 2022 20:08:00 +0800 Received: from localhost.localdomain (10.67.164.66) by dggpemm500005.china.huawei.com (7.185.36.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 19 Sep 2022 20:08:00 +0800 From: Yang Shen To: , CC: , , Subject: [RFC PATCH 1/6] moduleparams: Add hexulong type parameter Date: Mon, 19 Sep 2022 20:05:32 +0800 Message-ID: <20220919120537.39258-2-shenyang39@huawei.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20220919120537.39258-1-shenyang39@huawei.com> References: <20220919120537.39258-1-shenyang39@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.164.66] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500005.china.huawei.com (7.185.36.74) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Due to the bitmap.h uses a unsigned long pointer for bitmap variable, Add an 'hexulong' is more convenient. Signed-off-by: Yang Shen --- 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