Skip to content

Commit cea0e24

Browse files
committed
patcher: fix preprocessor macro usage
HAVE__CLEAR_CACHE is either defined or not; it is not defined to 0 or 1. Signed-off-by: Jeff Squyres <jeff@squyres.com>
1 parent 739d2d8 commit cea0e24

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

opal/mca/patcher/base/patcher_base_patch.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* and Technology (RIST). All rights reserved.
77
* Copyright (c) 2022 Amazon.com, Inc. or its affiliates.
88
* All Rights reserved.
9+
* Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
910
* $COPYRIGHT$
1011
*
1112
* Additional copyrights may follow
@@ -84,7 +85,7 @@ static int PatchLoadImm(uintptr_t addr, unsigned int reg, size_t value)
8485

8586
#endif
8687

87-
#if !HAVE___CLEAR_CACHE
88+
#if !defined(HAVE___CLEAR_CACHE)
8889
static void flush_and_invalidate_cache(unsigned long a)
8990
{
9091
# if defined(PLATFORM_ARCH_X86)
@@ -149,7 +150,7 @@ static inline void apply_patch(unsigned char *patch_data, uintptr_t address, siz
149150
{
150151
ModifyMemoryProtection(address, data_size, PROT_EXEC | PROT_READ | PROT_WRITE);
151152
memcpy((void *) address, patch_data, data_size);
152-
#if HAVE___CLEAR_CACHE
153+
#if defined(HAVE___CLEAR_CACHE)
153154
/* do not allow global declaration of compiler intrinsic */
154155
void __clear_cache(void *beg, void *end);
155156

0 commit comments

Comments
 (0)