linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cristina Moraru <cristina.moraru09@gmail.com>
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 <cristina.moraru09@gmail.com>
Subject: [RFC PATCH 1/3] Add kconfig_symbol attribute to struct module
Date: Sun, 31 Jul 2016 17:33:50 +0200	[thread overview]
Message-ID: <1469979232-15531-2-git-send-email-cristina.moraru09@gmail.com> (raw)
In-Reply-To: <1469979232-15531-1-git-send-email-cristina.moraru09@gmail.com>

Create additional attribute in struct module
in order for each module to store its associate
kconfig CONFIG_* symbol.

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 existent devices.

This patch is part of a research project within
Google Summer of Code of porting 'make localmodconfig'
for backported drivers.

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
---
 include/linux/module.h | 1 +
 kernel/module.c        | 1 +
 2 files changed, 2 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..4463c6c 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];
 
-- 
2.7.4

  reply	other threads:[~2016-07-31 15:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-31 15:33 [RFC PATCH 0/3] Add kconfig symbol as module attribute Cristina Moraru
2016-07-31 15:33 ` Cristina Moraru [this message]
2016-07-31 15:33 ` [RFC PATCH 2/3] Add generation of Module.ksymb file in streamline_config.pl Cristina Moraru
2016-08-08 19:15   ` Luis R. Rodriguez
2016-08-08 20:32     ` Julia Lawall
2016-08-08 21:54       ` Luis R. Rodriguez
2016-08-09  6:54     ` Geert Uytterhoeven
2016-07-31 15:33 ` [RFC PATCH 3/3] Add dynamic pegging of Kconfig symbol Cristina Moraru
2016-08-08 20:05   ` Luis R. Rodriguez
2016-08-08 17:25 ` [RFC PATCH 0/3] Add kconfig symbol as module attribute Luis R. Rodriguez

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=1469979232-15531-2-git-send-email-cristina.moraru09@gmail.com \
    --to=cristina.moraru09@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=kay@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=teg@jklm.no \
    /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;
as well as URLs for NNTP newsgroup(s).