From: Matthew Wilcox <matthew@wil.cx>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Adrian Bunk <bunk@kernel.org>,
Andrea Righi <righi.andrea@gmail.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: __weak vs ifdef
Date: Fri, 25 Jul 2008 06:24:54 -0600 [thread overview]
Message-ID: <20080725122454.GE6701@parisc-linux.org> (raw)
In-Reply-To: <20080725023455.dde3eb27.akpm@linux-foundation.org>
On Fri, Jul 25, 2008 at 02:34:55AM -0700, Andrew Morton wrote:
> We should make arch_pick_mmap_layout __weak and nuke that ifdef.
I strongly disagree. I find it makes it harder to follow code flow
when __weak functions are involved. Ifdefs are ugly, no question, but
they're easier to grep for, see when they'll be defined and know which of
the arch_pick_mmap_layout() functions will be called. __weak certainly
has its uses (eg the sys_ni_syscall is great) but I find it's becoming
overused.
My basic point here is that __weak makes the code easier to write but
harder to read, and we're supposed to be optimising for easier to read.
--
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
next prev parent reply other threads:[~2008-07-25 12:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-25 8:39 PAGE_ALIGN() compile breakage Adrian Bunk
2008-07-25 8:55 ` Andrew Morton
2008-07-25 9:14 ` Adrian Bunk
2008-07-25 9:25 ` Andrew Morton
2008-07-25 18:34 ` Andrea Righi
2008-07-25 9:27 ` Adrian Bunk
2008-07-25 9:34 ` Andrew Morton
2008-07-25 12:24 ` Matthew Wilcox [this message]
2008-07-25 12:41 ` __weak vs ifdef Andrew Morton
2008-07-26 19:38 ` Linus Torvalds
2010-02-18 2:07 ` Grant Likely
2010-02-18 2:22 ` Linus Torvalds
2008-07-26 21:22 ` [-mm patch] mm/util.c must #include <linux/sched.h> Adrian Bunk
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=20080725122454.GE6701@parisc-linux.org \
--to=matthew@wil.cx \
--cc=akpm@linux-foundation.org \
--cc=bunk@kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=righi.andrea@gmail.com \
--cc=torvalds@linux-foundation.org \
/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;
as well as URLs for NNTP newsgroup(s).