public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] module: Fix compile error for ref_module when CONFIG_MODULES is not set
@ 2012-08-01 17:57 Barbaros Tokaoğlu
  2012-08-06  0:30 ` Rusty Russell
  0 siblings, 1 reply; 3+ messages in thread
From: Barbaros Tokaoğlu @ 2012-08-01 17:57 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-kernel

ref_module function is not defined when CONFIG_MODULES is not set thus
it causes compile error when a module which is set to be built-in uses it.
This patch defines a dummy ref_module function when CONFIG_MODULES
is not set.

Signed-off-by: Barbaros Tokaoğlu <barbarost@gmail.com>
---
 include/linux/module.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/include/linux/module.h b/include/linux/module.h
index fbcafe2..ba9a7d0 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -553,6 +553,11 @@ static inline void module_put(struct module *module)
 {
 }

+static inline int ref_module(struct module *a, struct module *b)
+{
+       return 0;
+}
+
 #define module_name(mod) "kernel"

 /* For kallsyms to ask for address resolution.  NULL means not found. */
--
1.7.5.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] module: Fix compile error for ref_module when CONFIG_MODULES is not set
  2012-08-01 17:57 [PATCH] module: Fix compile error for ref_module when CONFIG_MODULES is not set Barbaros Tokaoğlu
@ 2012-08-06  0:30 ` Rusty Russell
  2012-08-06 14:57   ` Barbaros Tokaoğlu
  0 siblings, 1 reply; 3+ messages in thread
From: Rusty Russell @ 2012-08-06  0:30 UTC (permalink / raw)
  To: Barbaros Tokaoğlu; +Cc: linux-kernel

On Wed, 1 Aug 2012 20:57:07 +0300, Barbaros Tokaoğlu <barbarost@gmail.com> wrote:
> ref_module function is not defined when CONFIG_MODULES is not set thus
> it causes compile error when a module which is set to be built-in uses it.
> This patch defines a dummy ref_module function when CONFIG_MODULES
> is not set.
> 
> Signed-off-by: Barbaros Tokaoğlu <barbarost@gmail.com>

Hi Barbaros,

        It's usually a good idea to paste the error message into the
commit message for compile fixes: it helps people googling the problem.

In this case, it's particularly important, because I can't find any
users of ref_module() outside module.c itself: it's only exported for
ksplice to use.

Cheers,
Rusty.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] module: Fix compile error for ref_module when CONFIG_MODULES is not set
  2012-08-06  0:30 ` Rusty Russell
@ 2012-08-06 14:57   ` Barbaros Tokaoğlu
  0 siblings, 0 replies; 3+ messages in thread
From: Barbaros Tokaoğlu @ 2012-08-06 14:57 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-kernel@vger.kernel.org

Hi Rusty,

You are right, this was not for something in the kernel. I needed
ref_module to add some sort of dynamic dependency between modules but
this caused compile error when CONFIG_MODULES is not set. Another
option was using #ifdef CONFIG_MODULES check but the way in the patch
seemed correct to me.

However, if ref_module is exported only for ksplice, then you can
ignore this patch.

Thanks,
Barbaros

On Aug 6, 2012, at 9:58 AM, Rusty Russell <rusty@rustcorp.com.au> wrote:

> On Wed, 1 Aug 2012 20:57:07 +0300, Barbaros Tokaoğlu <barbarost@gmail.com> wrote:
>> ref_module function is not defined when CONFIG_MODULES is not set thus
>> it causes compile error when a module which is set to be built-in uses it.
>> This patch defines a dummy ref_module function when CONFIG_MODULES
>> is not set.
>>
>> Signed-off-by: Barbaros Tokaoğlu <barbarost@gmail.com>
>
> Hi Barbaros,
>
>       It's usually a good idea to paste the error message into the
> commit message for compile fixes: it helps people googling the problem.
>
> In this case, it's particularly important, because I can't find any
> users of ref_module() outside module.c itself: it's only exported for
> ksplice to use.
>
> Cheers,
> Rusty.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-06 14:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-01 17:57 [PATCH] module: Fix compile error for ref_module when CONFIG_MODULES is not set Barbaros Tokaoğlu
2012-08-06  0:30 ` Rusty Russell
2012-08-06 14:57   ` Barbaros Tokaoğlu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox