From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932305AbcHQT2K (ORCPT ); Wed, 17 Aug 2016 15:28:10 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33064 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932219AbcHQT2A (ORCPT ); Wed, 17 Aug 2016 15:28:00 -0400 From: Cristina Moraru To: linux-kernel@vger.kernel.org Cc: mcgrof@kernel.org, teg@jklm.no, kay@vrfy.org, rusty@rustcorp.com.au, akpm@linux-foundation.org, Cristina Moraru Subject: [RFC PATCH 5/5] Add kconf_symb as kernel module attribute Date: Wed, 17 Aug 2016 21:27:03 +0200 Message-Id: <1471462023-119645-6-git-send-email-cristina.moraru09@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1471462023-119645-1-git-send-email-cristina.moraru09@gmail.com> References: <1471462023-119645-1-git-send-email-cristina.moraru09@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add kconf_symbol attribute to kernel struct module. This patch is part of a research project within Google Summer of Code of porting 'make localmodconfig' for backported drivers. The goal is to enable each module to expose in /sys its corresponding CONFIG_* option. The value of this attribute will be dynamically pegged by modpost without requiring extra work from the driver developers. Further, this information will be used by a hardware interogation tool to extract build information about the existing devices. Signed-off-by: Cristina Moraru --- include/linux/module.h | 1 + kernel/module.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/include/linux/module.h b/include/linux/module.h index 3daf2b3..bef5e44 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -353,6 +353,7 @@ struct module { struct module_attribute *modinfo_attrs; const char *version; const char *srcversion; + const char *kconfig_symbol; struct kobject *holders_dir; /* Exported symbols */ diff --git a/kernel/module.c b/kernel/module.c index 5f71aa6..bb27300 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -757,6 +757,7 @@ static struct module_attribute modinfo_##field = { \ MODINFO_ATTR(version); MODINFO_ATTR(srcversion); +MODINFO_ATTR(kconfig_symbol); static char last_unloaded_module[MODULE_NAME_LEN+1]; @@ -1229,6 +1230,7 @@ static struct module_attribute *modinfo_attrs[] = { &module_uevent, &modinfo_version, &modinfo_srcversion, + &modinfo_kconfig_symbol, &modinfo_initstate, &modinfo_coresize, &modinfo_initsize, -- 2.7.4