[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+rthh_-i2z3hrsefD2dTXitoSfbMcnqmWS17T8jweHQPA2FWQ@mail.gmail.com>
Date: Tue, 24 Jun 2014 22:13:52 +0200
From: Mathias Krause <minipli@...glemail.com>
To: Joe Perches <joe@...ches.com>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Steven Rostedt <rostedt@...dmis.org>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, Jason Baron <jbaron@...hat.com>
Subject: Re: [RFC PATCH 1/3] init.h: Add __init_str / __exit_str macros
On 24 June 2014 21:43, Joe Perches <joe@...ches.com> wrote:
> On Mon, 2014-06-23 at 00:46 +0200, Mathias Krause wrote:
>> Add macros to be able to mark string literals used in __init / __exit
>> functions.
> []
>> diff --git a/include/linux/init.h b/include/linux/init.h
> []
>> +#define __init_str(str) __mark_str(str, __UNIQUE_ID(_init_str_), __initconst)
>> +#define __exit_str(str) __mark_str(str, __UNIQUE_ID(_exit_str_), __exitdata)
>> +#define __mark_str(str, var, __section) \
>> + ({ static const char var[] __section __aligned(1) = str; var; })
>> +
>
> You probably want to make these strings vanish
> completely when !CONFIG_PRINTK.
>
> As is, they will always exist in the image.
They will not. They are vanished as printk() is an empty static inline
function for the !CONFIG_PRINTK case. gcc is clever enough to optimize
the variables away in this case.
Thanks,
Mathias
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists