linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/alternatives: fixup alternative_call_2
@ 2017-12-25 15:06 Alexey Dobriyan
  2018-01-14 11:54 ` Thomas Gleixner
  0 siblings, 1 reply; 5+ messages in thread
From: Alexey Dobriyan @ 2017-12-25 15:06 UTC (permalink / raw)
  To: tglx, mingo, hpa; +Cc: x86, linux-kernel

The following pattern fails to compile while the same pattern
with alternative_call() does.

	if (...)
		alternative_call_2(...);
	else
		alternative_call_2(...);

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 arch/x86/include/asm/alternative.h |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/arch/x86/include/asm/alternative.h
+++ b/arch/x86/include/asm/alternative.h
@@ -218,13 +218,11 @@ static inline int alternatives_text_reserved(void *start, void *end)
  */
 #define alternative_call_2(oldfunc, newfunc1, feature1, newfunc2, feature2,   \
 			   output, input...)				      \
-{									      \
 	asm volatile (ALTERNATIVE_2("call %P[old]", "call %P[new1]", feature1,\
 		"call %P[new2]", feature2)				      \
 		: output, ASM_CALL_CONSTRAINT				      \
 		: [old] "i" (oldfunc), [new1] "i" (newfunc1),		      \
-		  [new2] "i" (newfunc2), ## input);			      \
-}
+		  [new2] "i" (newfunc2), ## input)
 
 /*
  * use this macro(s) if you need more than one output parameter

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

* Re: [PATCH] x86/alternatives: fixup alternative_call_2
  2017-12-25 15:06 [PATCH] x86/alternatives: fixup alternative_call_2 Alexey Dobriyan
@ 2018-01-14 11:54 ` Thomas Gleixner
  2018-01-14 12:05   ` [PATCH v2] " Alexey Dobriyan
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Gleixner @ 2018-01-14 11:54 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: mingo, hpa, x86, linux-kernel

On Mon, 25 Dec 2017, Alexey Dobriyan wrote:

> The following pattern fails to compile while the same pattern
> with alternative_call() does.
> 
> 	if (...)
> 		alternative_call_2(...);
> 	else
> 		alternative_call_2(...);

Sigh. Can we get an explanation WHY it fails ?

> 
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> ---
> 
>  arch/x86/include/asm/alternative.h |    4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> --- a/arch/x86/include/asm/alternative.h
> +++ b/arch/x86/include/asm/alternative.h
> @@ -218,13 +218,11 @@ static inline int alternatives_text_reserved(void *start, void *end)
>   */
>  #define alternative_call_2(oldfunc, newfunc1, feature1, newfunc2, feature2,   \
>  			   output, input...)				      \
> -{									      \
>  	asm volatile (ALTERNATIVE_2("call %P[old]", "call %P[new1]", feature1,\
>  		"call %P[new2]", feature2)				      \
>  		: output, ASM_CALL_CONSTRAINT				      \
>  		: [old] "i" (oldfunc), [new1] "i" (newfunc1),		      \
> -		  [new2] "i" (newfunc2), ## input);			      \
> -}
> +		  [new2] "i" (newfunc2), ## input)
>  
>  /*
>   * use this macro(s) if you need more than one output parameter
> 

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

* [PATCH v2] x86/alternatives: fixup alternative_call_2
  2018-01-14 11:54 ` Thomas Gleixner
@ 2018-01-14 12:05   ` Alexey Dobriyan
  2018-03-26 10:37     ` [tip:x86/asm] x86/alternatives: Fixup alternative_call_2 tip-bot for Alexey Dobriyan
  2018-03-27  7:51     ` [tip:x86/pti] " tip-bot for Alexey Dobriyan
  0 siblings, 2 replies; 5+ messages in thread
From: Alexey Dobriyan @ 2018-01-14 12:05 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: mingo, hpa, x86, linux-kernel

The following pattern fails to compile while the same pattern
with alternative_call() does:

	if (...)
		alternative_call_2(...);
	else
		alternative_call_2(...);

as it expands into

	if (...)
	{
	};	<===
	else
	{
	};

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 arch/x86/include/asm/alternative.h |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/arch/x86/include/asm/alternative.h
+++ b/arch/x86/include/asm/alternative.h
@@ -218,13 +218,11 @@ static inline int alternatives_text_reserved(void *start, void *end)
  */
 #define alternative_call_2(oldfunc, newfunc1, feature1, newfunc2, feature2,   \
 			   output, input...)				      \
-{									      \
 	asm volatile (ALTERNATIVE_2("call %P[old]", "call %P[new1]", feature1,\
 		"call %P[new2]", feature2)				      \
 		: output, ASM_CALL_CONSTRAINT				      \
 		: [old] "i" (oldfunc), [new1] "i" (newfunc1),		      \
-		  [new2] "i" (newfunc2), ## input);			      \
-}
+		  [new2] "i" (newfunc2), ## input)
 
 /*
  * use this macro(s) if you need more than one output parameter

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

* [tip:x86/asm] x86/alternatives: Fixup alternative_call_2
  2018-01-14 12:05   ` [PATCH v2] " Alexey Dobriyan
@ 2018-03-26 10:37     ` tip-bot for Alexey Dobriyan
  2018-03-27  7:51     ` [tip:x86/pti] " tip-bot for Alexey Dobriyan
  1 sibling, 0 replies; 5+ messages in thread
From: tip-bot for Alexey Dobriyan @ 2018-03-26 10:37 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: hpa, tglx, adobriyan, linux-kernel, bp, mingo

Commit-ID:  668120ab7ee4db67618ec75a0ebc93eae6c70034
Gitweb:     https://git.kernel.org/tip/668120ab7ee4db67618ec75a0ebc93eae6c70034
Author:     Alexey Dobriyan <adobriyan@gmail.com>
AuthorDate: Sun, 14 Jan 2018 15:05:04 +0300
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Mon, 26 Mar 2018 12:32:40 +0200

x86/alternatives: Fixup alternative_call_2

The following pattern fails to compile while the same pattern
with alternative_call() does:

	if (...)
		alternative_call_2(...);
	else
		alternative_call_2(...);

as it expands into

	if (...)
	{
	};	<===
	else
	{
	};

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20180114120504.GA11368@avx2

---
 arch/x86/include/asm/alternative.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h
index cf5961ca8677..4cd6a3b71824 100644
--- a/arch/x86/include/asm/alternative.h
+++ b/arch/x86/include/asm/alternative.h
@@ -218,13 +218,11 @@ static inline int alternatives_text_reserved(void *start, void *end)
  */
 #define alternative_call_2(oldfunc, newfunc1, feature1, newfunc2, feature2,   \
 			   output, input...)				      \
-{									      \
 	asm volatile (ALTERNATIVE_2("call %P[old]", "call %P[new1]", feature1,\
 		"call %P[new2]", feature2)				      \
 		: output, ASM_CALL_CONSTRAINT				      \
 		: [old] "i" (oldfunc), [new1] "i" (newfunc1),		      \
-		  [new2] "i" (newfunc2), ## input);			      \
-}
+		  [new2] "i" (newfunc2), ## input)
 
 /*
  * use this macro(s) if you need more than one output parameter

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

* [tip:x86/pti] x86/alternatives: Fixup alternative_call_2
  2018-01-14 12:05   ` [PATCH v2] " Alexey Dobriyan
  2018-03-26 10:37     ` [tip:x86/asm] x86/alternatives: Fixup alternative_call_2 tip-bot for Alexey Dobriyan
@ 2018-03-27  7:51     ` tip-bot for Alexey Dobriyan
  1 sibling, 0 replies; 5+ messages in thread
From: tip-bot for Alexey Dobriyan @ 2018-03-27  7:51 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: adobriyan, bp, mingo, tglx, hpa, linux-kernel

Commit-ID:  bd6271039ee6f0c9b468148fc2d73e0584af6b4f
Gitweb:     https://git.kernel.org/tip/bd6271039ee6f0c9b468148fc2d73e0584af6b4f
Author:     Alexey Dobriyan <adobriyan@gmail.com>
AuthorDate: Sun, 14 Jan 2018 15:05:04 +0300
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Tue, 27 Mar 2018 09:47:53 +0200

x86/alternatives: Fixup alternative_call_2

The following pattern fails to compile while the same pattern
with alternative_call() does:

	if (...)
		alternative_call_2(...);
	else
		alternative_call_2(...);

as it expands into

	if (...)
	{
	};	<===
	else
	{
	};

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20180114120504.GA11368@avx2

---
 arch/x86/include/asm/alternative.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h
index cf5961ca8677..4cd6a3b71824 100644
--- a/arch/x86/include/asm/alternative.h
+++ b/arch/x86/include/asm/alternative.h
@@ -218,13 +218,11 @@ static inline int alternatives_text_reserved(void *start, void *end)
  */
 #define alternative_call_2(oldfunc, newfunc1, feature1, newfunc2, feature2,   \
 			   output, input...)				      \
-{									      \
 	asm volatile (ALTERNATIVE_2("call %P[old]", "call %P[new1]", feature1,\
 		"call %P[new2]", feature2)				      \
 		: output, ASM_CALL_CONSTRAINT				      \
 		: [old] "i" (oldfunc), [new1] "i" (newfunc1),		      \
-		  [new2] "i" (newfunc2), ## input);			      \
-}
+		  [new2] "i" (newfunc2), ## input)
 
 /*
  * use this macro(s) if you need more than one output parameter

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

end of thread, other threads:[~2018-03-27  7:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-25 15:06 [PATCH] x86/alternatives: fixup alternative_call_2 Alexey Dobriyan
2018-01-14 11:54 ` Thomas Gleixner
2018-01-14 12:05   ` [PATCH v2] " Alexey Dobriyan
2018-03-26 10:37     ` [tip:x86/asm] x86/alternatives: Fixup alternative_call_2 tip-bot for Alexey Dobriyan
2018-03-27  7:51     ` [tip:x86/pti] " tip-bot for Alexey Dobriyan

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).