From: Nishanth Aravamudan <nacc@us.ibm.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] thread_info.h use kzalloc
Date: Tue, 11 Jul 2006 17:05:16 +0000 [thread overview]
Message-ID: <20060711170516.GG4250@us.ibm.com> (raw)
In-Reply-To: <8ef77f2e0607110947j6fd6ec3fgb180f05ca8654eb8@mail.gmail.com>
On 11.07.2006 [18:47:14 +0200], tom hisch wrote:
> hello,
>
> i have some questions about the alloc_thread_info(tsk) macro in
> asm-i386/thread_info.h
>
>
> /* thread information allocation */
> #ifdef CONFIG_DEBUG_STACK_USAGE
> #define alloc_thread_info(tsk) \
> ({ \
> struct thread_info *ret; \
> \
> ------> ret = kmalloc(THREAD_SIZE, GFP_KERNEL); \ // what
> about the use of kzalloc ??
> if (ret) \
> memset(ret, 0, THREAD_SIZE); \
Probably a reasonable change.
> ------> ret; \ // whats
> the meaning of this instruction ??
> })
I think it's part of the magic of the ({ }) gcc'ism, which allows the
macro to effectively have a return value (that's how I think of it, at
least) without a return statement (in this case, the value of ret will
be stored in the corresponding lhs). I'm sure the real explanation can
be found in the gcc manual in the ({ }) section.
Thanks,
Nish
--
Nishanth Aravamudan <nacc@us.ibm.com>
IBM Linux Technology Center
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
next prev parent reply other threads:[~2006-07-11 17:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-11 16:47 [KJ] thread_info.h use kzalloc tom hisch
2006-07-11 17:05 ` Nishanth Aravamudan [this message]
2006-07-11 17:09 ` Alexey Dobriyan
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=20060711170516.GG4250@us.ibm.com \
--to=nacc@us.ibm.com \
--cc=kernel-janitors@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.