From: Rusty Russell <rusty@rustcorp.com.au>
To: torvalds@transmeta.com, akpm@zip.com.au, rth@twiddle.net
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] __optional and __keep
Date: Thu, 15 May 2003 12:09:25 +1000 [thread overview]
Message-ID: <20030515021624.B814B2C017@lists.samba.org> (raw)
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.
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .21892-linux-2.5.69-bk9/include/linux/compiler.h .21892-linux-2.5.69-bk9.updated/include/linux/compiler.h
--- .21892-linux-2.5.69-bk9/include/linux/compiler.h 2003-04-20 18:05:14.000000000 +1000
+++ .21892-linux-2.5.69-bk9.updated/include/linux/compiler.h 2003-05-15 11:11:19.000000000 +1000
@@ -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 */
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .21892-linux-2.5.69-bk9/scripts/modpost.c .21892-linux-2.5.69-bk9.updated/scripts/modpost.c
--- .21892-linux-2.5.69-bk9/scripts/modpost.c 2003-05-05 12:37:16.000000000 +1000
+++ .21892-linux-2.5.69-bk9.updated/scripts/modpost.c 2003-05-15 11:11:19.000000000 +1000
@@ -466,7 +466,7 @@ add_depends(struct buffer *b, struct mod
buf_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) {
next reply other threads:[~2003-05-15 2:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-15 2:09 Rusty Russell [this message]
2003-05-15 5:54 ` Randy.Dunlap
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030515021624.B814B2C017@lists.samba.org \
--to=rusty@rustcorp.com.au \
--cc=akpm@zip.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=rth@twiddle.net \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®