aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2018-06-29 10:28:44 -0400
committerThomas Gleixner <tglx@linutronix.de>2018-08-02 08:30:42 -0400
commit216a37202f10b7d78f2f98e26a6681f367165f05 (patch)
tree11e0d4eb2374344178b7f7dcaccbe03d169fb5bf
parent5db1b1e1ee34871b1965b3f890e3ccbdb185fa52 (diff)
x86/boot: Use CC_SET()/CC_OUT() instead of open coding it
Remove open-coded uses of set instructions with CC_SET()/CC_OUT(). Signed-off-by: Uros Bizjak <ubizjak@gmail.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20180629142844.15200-1-ubizjak@gmail.com
-rw-r--r--arch/x86/boot/bitops.h3
-rw-r--r--arch/x86/boot/string.c5
2 files changed, 5 insertions, 3 deletions
diff --git a/arch/x86/boot/bitops.h b/arch/x86/boot/bitops.h
index 0d41d68131cc..2e1382486e91 100644
--- a/arch/x86/boot/bitops.h
+++ b/arch/x86/boot/bitops.h
@@ -17,6 +17,7 @@
17#define _LINUX_BITOPS_H /* Inhibit inclusion of <linux/bitops.h> */ 17#define _LINUX_BITOPS_H /* Inhibit inclusion of <linux/bitops.h> */
18 18
19#include <linux/types.h> 19#include <linux/types.h>
20#include <asm/asm.h>
20 21
21static inline bool constant_test_bit(int nr, const void *addr) 22static inline bool constant_test_bit(int nr, const void *addr)
22{ 23{
@@ -28,7 +29,7 @@ static inline bool variable_test_bit(int nr, const void *addr)
28 bool v; 29 bool v;
29 const u32 *p = (const u32 *)addr; 30 const u32 *p = (const u32 *)addr;
30 31
31 asm("btl %2,%1; setc %0" : "=qm" (v) : "m" (*p), "Ir" (nr)); 32 asm("btl %2,%1" CC_SET(c) : CC_OUT(c) (v) : "m" (*p), "Ir" (nr));
32 return v; 33 return v;
33} 34}
34 35
diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c
index 16f49123d747..c4428a176973 100644
--- a/arch/x86/boot/string.c
+++ b/arch/x86/boot/string.c
@@ -13,6 +13,7 @@
13 */ 13 */
14 14
15#include <linux/types.h> 15#include <linux/types.h>
16#include <asm/asm.h>
16#include "ctype.h" 17#include "ctype.h"
17#include "string.h" 18#include "string.h"
18 19
@@ -28,8 +29,8 @@
28int memcmp(const void *s1, const void *s2, size_t len) 29int memcmp(const void *s1, const void *s2, size_t len)
29{ 30{
30 bool diff; 31 bool diff;
31 asm("repe; cmpsb; setnz %0" 32 asm("repe; cmpsb" CC_SET(nz)
32 : "=qm" (diff), "+D" (s1), "+S" (s2), "+c" (len)); 33 : CC_OUT(nz) (diff), "+D" (s1), "+S" (s2), "+c" (len));
33 return diff; 34 return diff;
34} 35}
35 36