Re: [PATCH v1 02/11] backports: extend module_init() module_exit() for built-in

From: Johannes Berg
Date: Tue Nov 04 2014 - 05:03:00 EST


On Tue, 2014-11-04 at 00:42 -0800, Luis R. Rodriguez wrote:

> +#ifndef MODULE
> +/*
> + * Forcing the backports module to load allows us to easily
> + * identify the backport.
> + */

That comment is wrong really, making the dependency on the symbol forced
the backport module to load but if it's built-in that makes no sense.

> +#undef module_init
> +#define module_init(fn) \
> + static int __init __init_backport_##fn(void) \
> + { \
> + backport_dependency_symbol(); \

That won't do anything at all after all.

> + return fn(); \
> + } \
> + __initcall(__init_backport_##fn);
> +
> +#undef module_exit
> +#define module_exit(fn) \
> + static void __exit __exit_backport_##fn(void) \
> + { \
> + fn(); \
> + rcu_barrier(); \
> + } \
> + __exitcall(__exit_backport_##fn);

This is also pointless if it's built-in.

I don't think this patch makes sense, you just want to add the "#ifdef
MODULE" I guess.

johannes


--
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/