Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 216a3720 authored by Uros Bizjak's avatar Uros Bizjak Committed by Thomas Gleixner
Browse files

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: default avatarUros Bizjak <ubizjak@gmail.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20180629142844.15200-1-ubizjak@gmail.com
parent 5db1b1e1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#define _LINUX_BITOPS_H		/* Inhibit inclusion of <linux/bitops.h> */

#include <linux/types.h>
#include <asm/asm.h>

static inline bool constant_test_bit(int nr, const void *addr)
{
@@ -28,7 +29,7 @@ static inline bool variable_test_bit(int nr, const void *addr)
	bool v;
	const u32 *p = (const u32 *)addr;

	asm("btl %2,%1; setc %0" : "=qm" (v) : "m" (*p), "Ir" (nr));
	asm("btl %2,%1" CC_SET(c) : CC_OUT(c) (v) : "m" (*p), "Ir" (nr));
	return v;
}

+3 −2
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
 */

#include <linux/types.h>
#include <asm/asm.h>
#include "ctype.h"
#include "string.h"

@@ -28,8 +29,8 @@
int memcmp(const void *s1, const void *s2, size_t len)
{
	bool diff;
	asm("repe; cmpsb; setnz %0"
	    : "=qm" (diff), "+D" (s1), "+S" (s2), "+c" (len));
	asm("repe; cmpsb" CC_SET(nz)
	    : CC_OUT(nz) (diff), "+D" (s1), "+S" (s2), "+c" (len));
	return diff;
}