Re: [PATCH v9 4/6] init: allow initcall tables to be emitted using relative references

From: Sergey Senozhatsky
Date: Wed Jun 27 2018 - 10:21:02 EST


On (06/26/18 20:27), Ard Biesheuvel wrote:
> /*
> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> index 247808333ba4..688a27b0888c 100644
> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -2772,7 +2772,8 @@ EXPORT_SYMBOL(unregister_console);
> void __init console_init(void)
> {
> int ret;
> - initcall_t *call;
> + initcall_t call;
> + initcall_entry_t *ce;
>
> /* Setup the default TTY line discipline. */
> n_tty_init();
> @@ -2781,13 +2782,14 @@ void __init console_init(void)
> * set up the console device so that later boot sequences can
> * inform about problems etc..
> */
> - call = __con_initcall_start;
> + ce = __con_initcall_start;
> trace_initcall_level("console");
> - while (call < __con_initcall_end) {
> - trace_initcall_start((*call));
> - ret = (*call)();
> - trace_initcall_finish((*call), ret);
> - call++;
> + while (ce < __con_initcall_end) {
> + call = initcall_from_entry(ce);
> + trace_initcall_start(call);
> + ret = call();
> + trace_initcall_finish(call, ret);
> + ce++;
> }
> }

printk bits look OK to me.
The patch set works fine on my x86_64 and does reduce the size of vmlinux.

Acked-by: Sergey Senozhatsky <sergey.senozhatsky@xxxxxxxxx>

-ss