This message generated a parse failure. Raw output follows here. Please use 'back' to navigate. From devnull@lkml.org Tue Apr 16 17:31:49 2024 Delivery-date: Wed, 19 Jan 2005 17:16:09 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261768AbVASQO2 (ORCPT ); Wed, 19 Jan 2005 11:14:28 -0500 Received: from cantor.suse.de ([195.135.220.2]:33224 "EHLO Cantor.suse.de") by vger.kernel.org with ESMTP id S261767AbVASQOQ (ORCPT ); Wed, 19 Jan 2005 11:14:16 -0500 Received: from hermes.suse.de (hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id E5FAF136A900; Wed, 19 Jan 2005 17:14:15 +0100 (CET) Subject: Re: [kbuild 4/5] Include type information as module info where possible From: Andreas Gruenbacher To: "linux-kernel@vger.kernel.org" Cc: Sam Ravnborg , Rusty Russell In-Reply-To: <20050118192608.578877000.suse.de> References: <20050118184123.729034000.suse.de> <20050118192608.578877000.suse.de> Content-Type: multipart/mixed; boundary="=-pJBY60ffPsZ0tG98IOGA" Organization: SUSE Labs Message-Id: <1106151255.8642.11.camel@winden.suse.de> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Wed, 19 Jan 2005 17:14:15 +0100 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org --=-pJBY60ffPsZ0tG98IOGA Content-Type: text/plain Content-Transfer-Encoding: 7bit Hello, MODULE_PARM_TYPE needs to be moved to moduleparam.h: several files include moduleparam.h but not module.h. Regards, -- Andreas Gruenbacher SUSE Labs, SUSE LINUX GMBH --=-pJBY60ffPsZ0tG98IOGA Content-Disposition: attachment; filename=mod_param-typeinfo.diff Content-Type: message/rfc822; name=mod_param-typeinfo.diff From: Andreas Gruenbacher Originally-from: Rusty Russell Subject: Include type information as module info where possible References: 48396 Date: Wed, 19 Jan 2005 17:12:48 +0100 Message-Id: <1106151168.8642.9.camel@winden.suse.de> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Module parameters no longer have a type in general, as we use a callback system (module_param_call()). However, it's useful to include type information in the commonly-used wrappers: module_param, module_param_string and module_param_array. This adds a parmtype modinfo tag for each parameter defined using module_param() or MODULE_PARM(). This allows modinfo to easily print all parameters and their types, independent of whether or not the parameter has a description (MODULE_PARM_DESC()). Originally-signed-off-by: Rusty Russell Signed-off-by: Andreas Gruenbacher Index: linux-2.6.11-rc1-bk6/include/linux/moduleparam.h =================================================================== --- linux-2.6.11-rc1-bk6.orig/include/linux/moduleparam.h +++ linux-2.6.11-rc1-bk6/include/linux/moduleparam.h @@ -13,6 +13,10 @@ #define MODULE_PARAM_PREFIX __stringify(KBUILD_MODNAME) "." #endif +/* Type information for a module parameter. */ +#define MODULE_PARM_TYPE(name, _type) \ + __MODULE_INFO(parmtype, name##type, #name ":" _type) + struct kernel_param; /* Returns 0, or -errno. arg is in kp->arg. */ @@ -64,7 +68,8 @@ struct kparam_array param_set_XXX and param_check_XXX. */ #define module_param_named(name, value, type, perm) \ param_check_##type(name, &(value)); \ - module_param_call(name, param_set_##type, param_get_##type, &value, perm) + module_param_call(name, param_set_##type, param_get_##type, &value, perm); \ + MODULE_PARM_TYPE(name, #type) #define module_param(name, type, perm) \ module_param_named(name, name, type, perm) @@ -74,7 +79,8 @@ struct kparam_array static struct kparam_string __param_string_##name \ = { len, string }; \ module_param_call(name, param_set_copystring, param_get_string, \ - &__param_string_##name, perm) + &__param_string_##name, perm); \ + MODULE_PARM_TYPE(name, "string") /* Called on module insert or kernel boot */ extern int parse_args(const char *name, @@ -135,7 +141,8 @@ extern int param_get_invbool(char *buffe = { ARRAY_SIZE(array), nump, param_set_##type, param_get_##type,\ sizeof(array[0]), array }; \ module_param_call(name, param_array_set, param_array_get, \ - &__param_arr_##name, perm) + &__param_arr_##name, perm); \ + MODULE_PARM_TYPE(name, "array of " #type) #define module_param_array(name, type, nump, perm) \ module_param_array_named(name, name, type, nump, perm) Index: linux-2.6.11-rc1-bk6/include/linux/module.h =================================================================== --- linux-2.6.11-rc1-bk6.orig/include/linux/module.h +++ linux-2.6.11-rc1-bk6/include/linux/module.h @@ -560,7 +560,8 @@ static inline void MODULE_PARM_(void) { /* DEPRECATED: Do not use. */ #define MODULE_PARM(var,type) \ struct obsolete_modparm __parm_##var __attribute__((section("__obsparm"))) = \ -{ __stringify(var), type, &MODULE_PARM_ }; +{ __stringify(var), type, &MODULE_PARM_ }; \ +MODULE_PARM_TYPE(var, type); #else #define MODULE_PARM(var,type) static void __attribute__((__unused__)) *__parm_##var = &MODULE_PARM_; #endif --=-pJBY60ffPsZ0tG98IOGA-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/