linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Stephen Boyd <sboyd@codeaurora.org>
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
Subject: Re: [PATCH] Move most arches to asm-generic/current.h
Date: Mon, 30 Apr 2012 14:15:56 +0000	[thread overview]
Message-ID: <201204301415.56690.arnd@arndb.de> (raw)
In-Reply-To: <1335237509-17113-1-git-send-email-sboyd@codeaurora.org>

On Tuesday 24 April 2012, Stephen Boyd wrote:
> diff --git a/include/asm-generic/current.h b/include/asm-generic/current.h
> index 5e86f6a..bbfb795 100644
> --- a/include/asm-generic/current.h
> +++ b/include/asm-generic/current.h
> @@ -1,9 +1,16 @@
>  #ifndef __ASM_GENERIC_CURRENT_H
>  #define __ASM_GENERIC_CURRENT_H
>  
> +#include <linux/compiler.h>
>  #include <linux/thread_info.h>
>  
> -#define get_current() (current_thread_info()->task)
> +struct task_struct;
> +
> +static __always_inline struct task_struct *get_current(void)
> +{
> +       return current_thread_info()->task;
> +}
> +
>  #define current get_current()
>  
>  #endif /* __ASM_GENERIC_CURRENT_H */

Does this need to be an inline function rather than a macro? I think I
remember having trouble with header file dependencies when I tried making
it an inline function initially and I don't know if those have been
resolved.

I realize that the macro is ugly, but if you don't mind keeping it,
that would be the safer option in terms of breaking some architecture
in the process. If course if you can prove that all architectures using
the generic implementation can use the inline function, I'm all for
the change.

Aside from this, I very much like your patch.

Acked-by: Arnd Bergmann <arnd@arndb.de>

	Arnd

  parent reply	other threads:[~2012-04-30 14:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-24  3:18 [PATCH] Move most arches to asm-generic/current.h Stephen Boyd
2012-04-24  3:30 ` David Miller
2012-04-26 17:51 ` Stephen Boyd
2012-04-30  9:08 ` David Howells
2012-04-30 12:51 ` Chris Metcalf
2012-04-30 14:15 ` Arnd Bergmann [this message]
2012-04-30 16:35   ` Stephen Boyd
2012-04-30 16:38     ` Arnd Bergmann
2012-04-30 17:07       ` Stephen Boyd
2012-04-30 17:07         ` Stephen Boyd
2012-04-30 17:11         ` Matt Turner
2012-04-30 19:52         ` Arnd Bergmann
2012-08-22 19:25 ` [PATCH/RESEND] " Stephen Boyd
2012-08-22 19:25   ` Stephen Boyd

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=201204301415.56690.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sboyd@codeaurora.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).