public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] virtio tools: use ansi versions of asm and volatile
@ 2013-10-15 10:43 Ramkumar Ramachandra
  2013-10-16  0:09 ` Rusty Russell
  0 siblings, 1 reply; 3+ messages in thread
From: Ramkumar Ramachandra @ 2013-10-15 10:43 UTC (permalink / raw)
  To: LKML; +Cc: Rusty Russell, Michael S. Tsirkin

asm and volatile are provided for backward compatibility; use the ansi
versions __asm__ and __volatile__.

Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
 tools/virtio/asm/barrier.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/virtio/asm/barrier.h b/tools/virtio/asm/barrier.h
index aff61e1..b2fbbfc 100644
--- a/tools/virtio/asm/barrier.h
+++ b/tools/virtio/asm/barrier.h
@@ -1,5 +1,5 @@
 #if defined(__i386__) || defined(__x86_64__)
-#define barrier() asm volatile("" ::: "memory")
+#define barrier() __asm__ __volatile__("" ::: "memory")
 #define mb() __sync_synchronize()
 
 #define smp_mb()	mb()
-- 
1.8.4.477.g5d89aa9


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] virtio tools: use ansi versions of asm and volatile
  2013-10-15 10:43 [PATCH] virtio tools: use ansi versions of asm and volatile Ramkumar Ramachandra
@ 2013-10-16  0:09 ` Rusty Russell
  2013-10-17  6:24   ` Ramkumar Ramachandra
  0 siblings, 1 reply; 3+ messages in thread
From: Rusty Russell @ 2013-10-16  0:09 UTC (permalink / raw)
  To: Ramkumar Ramachandra, LKML; +Cc: Michael S. Tsirkin

Ramkumar Ramachandra <artagnon@gmail.com> writes:
> asm and volatile are provided for backward compatibility; use the ansi
> versions __asm__ and __volatile__.

Really?  I don't see that in the gcc documentation.  In fact, I didn't
know __volatile__ at all:

 If you are writing a header file that should be includable in ISO C
 programs, write `__asm__' instead of `asm'.  *Note Alternate Keywords::.

We're not...

Cheers,
Rusty.

> Cc: Rusty Russell <rusty@rustcorp.com.au>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
> ---
>  tools/virtio/asm/barrier.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/virtio/asm/barrier.h b/tools/virtio/asm/barrier.h
> index aff61e1..b2fbbfc 100644
> --- a/tools/virtio/asm/barrier.h
> +++ b/tools/virtio/asm/barrier.h
> @@ -1,5 +1,5 @@
>  #if defined(__i386__) || defined(__x86_64__)
> -#define barrier() asm volatile("" ::: "memory")
> +#define barrier() __asm__ __volatile__("" ::: "memory")
>  #define mb() __sync_synchronize()
>  
>  #define smp_mb()	mb()
> -- 
> 1.8.4.477.g5d89aa9

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] virtio tools: use ansi versions of asm and volatile
  2013-10-16  0:09 ` Rusty Russell
@ 2013-10-17  6:24   ` Ramkumar Ramachandra
  0 siblings, 0 replies; 3+ messages in thread
From: Ramkumar Ramachandra @ 2013-10-17  6:24 UTC (permalink / raw)
  To: Rusty Russell; +Cc: LKML, Michael S. Tsirkin

Rusty Russell wrote:
> Ramkumar Ramachandra <artagnon@gmail.com> writes:
>> asm and volatile are provided for backward compatibility; use the ansi
>> versions __asm__ and __volatile__.
>
> Really?  I don't see that in the gcc documentation.  In fact, I didn't
> know __volatile__ at all:

Try compiling the program with `gcc -ansi`, and you'll see that "asm"
and "volatile" are undeclared. The motivation for my patch comes from
barrier() being declared differently in compiler-gcc.h.

However, the tree is polluted with the non-ansi versions anyway;
compilers will continue to support them for decades. So, I'd request
you to drop the patch.

Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-17  6:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-15 10:43 [PATCH] virtio tools: use ansi versions of asm and volatile Ramkumar Ramachandra
2013-10-16  0:09 ` Rusty Russell
2013-10-17  6:24   ` Ramkumar Ramachandra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox