Re: [PATCH] Staging: Android: logger: module_exit implementationg

From: Ryan Mallon
Date: Sun Nov 04 2012 - 19:04:06 EST


On 04/11/12 04:45, Luca Clementi wrote:
> On Fri, Nov 2, 2012 at 11:29 AM, Greg Kroah-Hartman
> <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
>> On Thu, Nov 01, 2012 at 11:15:52PM -0700, Luca Clementi wrote:

<snip>

>>> + vfree(current_log->buffer);
>>> + kfree(current_log->misc.name);
>>> + kfree(current_log);
>>> + }
>>> +
>>> + return;
>>> +}
>>> +
>>> +
>>> +module_init(logger_init);
>>
>> Is module_init() the same "level" as device_initcall()? Did you test
>> this out in an Android system?
>
> Honestly I haven't tested it on Android, but in include/linux/init.h there is:
>
> #define module_init(x) __initcall(x);
> ...
> #define __initcall(fn) device_initcall(fn)
>
> Which lead me to think that there is not much difference between the two call.

The different initcalls run at different times. Often modules run with
something other than module_init if there are other dependencies on the
module/subsystem (see i2c core/busses for example). You would need to
check why logger was using device_initcall and make sure that it works
correctly (e.g. doesn't miss some early logs) in order to make this
change. It should be done as a separate patch anyway to make it easier
to identify any issues with it later.

~Ryan

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/