Skip to content

Commit c304eda

Browse files
minipli-osssean-jc
authored andcommitted
x86/access: Use 'bool' type as defined via libcflat.h
Drop the unneeded definitions of 'true' and 'false' and make use of the common 'bool' type instead of using the pre-C99 / post-C23 definitions. Signed-off-by: Mathias Krause <minipli@grsecurity.net> Link: https://lore.kernel.org/r/20230413184219.36404-6-minipli@grsecurity.net Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 00d585d commit c304eda

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

x86/access.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
#include "x86/vm.h"
66
#include "access.h"
77

8-
#define true 1
9-
#define false 0
10-
11-
static _Bool verbose = false;
8+
static bool verbose = false;
129

1310
typedef unsigned long pt_element_t;
1411
static int invalid_mask;
@@ -406,7 +403,7 @@ static int ac_test_bump_one(ac_test_t *at)
406403

407404
#define F(x) ((flags & x##_MASK) != 0)
408405

409-
static _Bool ac_test_legal(ac_test_t *at)
406+
static bool ac_test_legal(ac_test_t *at)
410407
{
411408
int flags = at->flags;
412409
unsigned reserved;
@@ -738,7 +735,7 @@ static void dump_mapping(ac_test_t *at)
738735
walk_va(at, F(AC_PDE_PSE) ? 2 : 1, virt, __dump_pte, false);
739736
}
740737

741-
static void ac_test_check(ac_test_t *at, _Bool *success_ret, _Bool cond,
738+
static void ac_test_check(ac_test_t *at, bool *success_ret, bool cond,
742739
const char *fmt, ...)
743740
{
744741
va_list ap;
@@ -780,7 +777,7 @@ static int ac_test_do_access(ac_test_t *at)
780777
unsigned e;
781778
static unsigned char user_stack[4096];
782779
unsigned long rsp;
783-
_Bool success = true;
780+
bool success = true;
784781
int flags = at->flags;
785782

786783
++unique;

0 commit comments

Comments
 (0)