From: Rusty Russell <rusty@rustcorp.com.au>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PULL] Wrapper macros for struct task_struct and struct mm_struct cpumask transition
Date: Thu, 12 Mar 2009 19:43:02 +1030 [thread overview]
Message-ID: <200903121943.02799.rusty@rustcorp.com.au> (raw)
In-Reply-To: <20090312003709.1196ce15.akpm@linux-foundation.org>
On Thursday 12 March 2009 18:07:09 Andrew Morton wrote:
> On Thu, 12 Mar 2009 17:45:22 +1030 Rusty Russell <rusty@rustcorp.com.au> wrote:
...
> Please prefer to put the patches in the email if practical? More
> eyeballs and all that.
Hmm, yes. Is there a preferred way of doing that with git request-pull?
Or just append the diff?
> : +/* Future-safe accessor for struct mm_struct's cpu_vm_mask. */
> : +#define mm_cpumask(mm) (&(mm)->cpu_vm_mask)
> : +
...
> It would be pretty perverse to run tsk_cpumask() against a `struct
> cpuset*', but your proposed implementation would merrily permit that
> mistake.
>
> Can we write the kernel in C please??
You mean use an inline? No, it's a bad idea for two reasons. The minor
reason is that this macro is a temporary so it makes more sense to fix the
final version.
But the major one is const correctness. Macros give a const value for
const input. We can enhance the macro to check, but that's even uglier:
static inline int check_is_task_struct(const struct task_struct *t) { }
#define tsk_cpumask(t) (sizeof(check_is_task_struct(t)), &(t)->cpu_vm_mask)
> yup, the patches are quite safe and mergeable. And if they'd been in the
> email body, Linus might have seen that and pulled them ;)
Probably not, as that's not what he complained about last time. He might have
been enlightened by the commit messages tho.
Cheers,
Rusty.
next prev parent reply other threads:[~2009-03-12 9:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-12 4:06 [PULL] Wrapper macros for struct task_struct and struct mm_struct cpumask transition Rusty Russell
2009-03-12 4:20 ` Nick Piggin
2009-03-12 7:15 ` Rusty Russell
2009-03-12 7:37 ` Andrew Morton
2009-03-12 9:13 ` Rusty Russell [this message]
2009-03-12 9:24 ` Andrew Morton
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=200903121943.02799.rusty@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=nickpiggin@yahoo.com.au \
--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