linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Marek <mmarek@suse.cz>
To: Vineet Gupta <Vineet.Gupta1@synopsys.com>,
	Chen Gang <gang.chen@asianux.com>,
	Al Viro <viro@zeniv.linux.org.uk>, Arnd Bergmann <arnd@arndb.de>,
	Rusty Russell <rusty@rustcorp.com.au>
Cc: James Hogan <james.hogan@imgtec.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Linux-Arch <linux-arch@vger.kernel.org>,
	Max Filippov <jcmvbkbc@gmail.com>,
	Tim Abbott <tabbott@ksplice.com>, Joe Perches <joe@perches.com>,
	David Howells <dhowells@redhat.com>
Subject: Re: [PATCH v2] arch: use ASM_NL instead of ';' for assembler new line character in the macro
Date: Fri, 03 Jan 2014 13:38:03 +0100	[thread overview]
Message-ID: <52C6AF2B.8050104@suse.cz> (raw)
In-Reply-To: <528DD92E.9070408@synopsys.com>

On 2013-11-21 10:58, Vineet Gupta wrote:
> On 11/01/2013 11:15 AM, Vineet Gupta wrote:
>> +CC Sam, Tim, Joe, Michal, David
>>
>> Guys can you please take a look at this patch and suggest the best way to merge.
>>
>> The root cause is some gas ports (including ARC) use ';' for comment (vs. newline)
>> More background at https://lkml.org/lkml/2013/10/24/365
> 
> Ping ! Any objections to this. Given that this is exception case, it is simpler
> than defining a Kconfig control.
> 
> -Vineet
>>
>>
>> On 10/29/2013 07:21 AM, Chen Gang wrote:
>>> For some assemblers, they use another character as newline in a macro
>>> (e.g. arc uses '`'), so for generic assembly code, need use ASM_NL (a
>>> macro) instead of ';' for it.
>>>
>>> Also need notice about code styles ('\t' for each line).
>>>
>>>
>>> Signed-off-by: Chen Gang <gang.chen@asianux.com>
>>> ---
>>>  arch/arc/include/asm/linkage.h |    2 ++
>>>  include/linux/linkage.h        |   19 ++++++++++++-------
>>>  2 files changed, 14 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/arch/arc/include/asm/linkage.h b/arch/arc/include/asm/linkage.h
>>> index 0283e9e..66ee552 100644
>>> --- a/arch/arc/include/asm/linkage.h
>>> +++ b/arch/arc/include/asm/linkage.h
>>> @@ -11,6 +11,8 @@
>>>  
>>>  #ifdef __ASSEMBLY__
>>>  
>>> +#define ASM_NL		 `	/* use '`' to mark new line in macro */
>>> +
>>>  /* Can't use the ENTRY macro in linux/linkage.h
>>>   * gas considers ';' as comment vs. newline
>>>   */
>>> diff --git a/include/linux/linkage.h b/include/linux/linkage.h
>>> index d3e8ad2..a6a42dd 100644
>>> --- a/include/linux/linkage.h
>>> +++ b/include/linux/linkage.h
>>> @@ -6,6 +6,11 @@
>>>  #include <linux/export.h>
>>>  #include <asm/linkage.h>
>>>  
>>> +/* Some toolchains use other characters (e.g. '`') to mark new line in macro */
>>> +#ifndef ASM_NL
>>> +#define ASM_NL		 ;
>>> +#endif
>>> +
>>>  #ifdef __cplusplus
>>>  #define CPP_ASMLINKAGE extern "C"
>>>  #else
>>> @@ -75,21 +80,21 @@
>>>  
>>>  #ifndef ENTRY
>>>  #define ENTRY(name) \
>>> -  .globl name; \
>>> -  ALIGN; \
>>> -  name:
>>> +	.globl name ASM_NL \
>>> +	ALIGN ASM_NL \
>>> +	name:
>>>  #endif
>>>  #endif /* LINKER_SCRIPT */
>>>  
>>>  #ifndef WEAK
>>>  #define WEAK(name)	   \
>>> -	.weak name;	   \
>>> +	.weak name ASM_NL   \
>>>  	name:
>>>  #endif
>>>  
>>>  #ifndef END
>>>  #define END(name) \
>>> -  .size name, .-name
>>> +	.size name, .-name
>>>  #endif
>>>  
>>>  /* If symbol 'name' is treated as a subroutine (gets called, and returns)
>>> @@ -98,8 +103,8 @@
>>>   */
>>>  #ifndef ENDPROC
>>>  #define ENDPROC(name) \
>>> -  .type name, @function; \
>>> -  END(name)
>>> +	.type name, @function ASM_NL \
>>> +	END(name)
>>>  #endif
>>>  
>>>  #endif
>>>
>>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

  parent reply	other threads:[~2014-01-03 12:38 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-28 10:30 [PATCH] arch: use ASM_NL instead of ';' for assembler new line character in the macro Chen Gang
2013-10-28 11:18 ` Max Filippov
2013-10-29  7:57   ` Chen Gang
2013-10-29  7:57     ` Chen Gang
2013-10-29  8:34     ` Max Filippov
2013-10-29  8:34       ` Max Filippov
2013-10-29  8:47       ` Chen Gang
2013-10-28 13:45 ` Vineet Gupta
2013-10-29  1:04   ` Chen Gang
2013-10-29  1:39     ` Chen Gang
2013-10-29  1:51       ` [PATCH v2] " Chen Gang
2013-10-29  5:55         ` Vineet Gupta
2013-10-29  6:07           ` Chen Gang
2013-11-01  5:45         ` Vineet Gupta
2013-11-21  9:58           ` Vineet Gupta
2013-11-21 10:52             ` Chen Gang
2014-01-03 12:38             ` Michal Marek [this message]
2014-01-03 12:38               ` Michal Marek
2014-01-06  5:36               ` Vineet Gupta
2014-01-06  9:26                 ` Michal Marek
2014-01-09  6:41                   ` Vineet Gupta
2014-01-10 15:48                     ` Chen Gang
2014-01-10 15:48                       ` Chen Gang
2014-01-12  1:59                       ` [PATCH v3] " Chen Gang
2014-01-18  9:44                         ` Chen Gang
2014-01-21  4:55                           ` Vineet Gupta
2014-01-25 11:07                             ` Chen Gang
2014-01-27 21:57                               ` Michal Marek
2014-01-30  5:41                                 ` Chen Gang
2014-01-30  5:41                                   ` Chen Gang
2013-10-29 10:39   ` [PATCH] " David Howells
2013-10-29 11:53     ` Chen Gang
2013-10-29 13:59     ` David Howells
2013-10-30  0:57       ` Chen Gang

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=52C6AF2B.8050104@suse.cz \
    --to=mmarek@suse.cz \
    --cc=Vineet.Gupta1@synopsys.com \
    --cc=arnd@arndb.de \
    --cc=dhowells@redhat.com \
    --cc=gang.chen@asianux.com \
    --cc=james.hogan@imgtec.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=joe@perches.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=tabbott@ksplice.com \
    --cc=viro@zeniv.linux.org.uk \
    /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).