__optional and __keep
PATCH 1/1 __optional and __keep
Hi all!
Does anyone else find __attribute_used__ confusing, or is it just me? In the tradition of likely() and unlikely(), I think __optional and __keep are clearer.
Thoughts?
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
Name: __keep and __optional attributes
Author: Rusty Russell
Status: Trivial
D: Renames __attribute_used to __keep, and introduces __optional.
include/linux/compiler.h +3 -2
@@ -51,10 +51,11 @@* would be warned about except with attribute((unused)). */ #if __GNUC__ ==3 && __GNUC_MINOR__ >=3 || __GNUC__ >3 -#define __attribute_used__ __attribute__((__used__)) +#define __keep __attribute__((__used__))#else -#define __attribute_used__ __attribute__((__unused__)) +#define __keep __attribute__((__unused__))#endif +#define __optional __attribute__((__unused__))/* This macro obfuscates arithmetic on a variable address so that gcc shouldn't recognize the original var, and make assumptions about it */
scripts/modpost.c +1 -1
@@ -466,7 +466,7 @@ add_depends(struct buffer *b, struct modbuf_printf (b,"\n" );buf_printf (b,"static const char __module_depends[]\n" ); -buf_printf (b,"__attribute_used__\n" ); +buf_printf (b,"__keep\n" );buf_printf (b,"__attribute__((section(\".modinfo\"))) =\n" );buf_printf (b,"\"depends=" );for (s = mod->unres; s; s = s->next) {
Quoted 9 lines
Hi all!
Does anyone else find
__attribute_used__confusing, or is it just me? In the tradition oflikely()andunlikely(), I think__optionaland__keepare clearer.Thoughts?
Rusty.
--
Yes, I thought that we had already hashed thru this one time. I'm fine with the current naming.
~Randy