[PATCH] PPC: use CURRENT_THREAD_INFO instead of open coded assembly

Alexander Graf agraf at suse.de
Tue Jul 3 07:34:21 EST 2012


On 02.07.2012, at 23:31, Scott Wood wrote:

> On 07/02/2012 04:27 PM, Alexander Graf wrote:
>> 
>> On 02.07.2012, at 23:26, Benjamin Herrenschmidt wrote:
>> 
>>> On Mon, 2012-07-02 at 22:59 +0200, Alexander Graf wrote:
>>>> This should go into an #ifdef __ASSEMBLY__ block, right? :)
>>> 
>>> We almost never use #ifdef __ASSEMBLY__, we use it the other way
>>> around, to prevent C stuff from being included in assembly. The
>>> other way around is legit since things might be used in inline asm
>>> for example.
>> 
>> I'm not sure I want to see this bit of code used as is in inline asm
>> :). I don't even think it's possible, since it's a full statement.
>> Either way, it's safer with the guard.
> 
> Safer from what?  It won't be expanded unless referenced.  How is this
> better than putting ifdefs on #includes, prototypes, struct definitions,
> etc.?  The ifdef is just clutter.

Well, it'd make it easier to read the errors resulting of it. Calling CURRENT_THREAD_INFO from within C code would throw random compiler errors at you that are quite unintelligible, while a missing definition would be a reasonably obvious thing to fix, no?

Either way, not married to this. I just find it cleaner to not expose something as a define that wouldn't work in the first place.


Alex



More information about the Linuxppc-dev mailing list