Skip to content

Commit aa9ff8d

Browse files
committed
target/esirisc_trace: drop macro BIT_MASK() conflicting with bits.h
The esirisc_trace.c uses macro BIT_MASK(), same name as a macro from helper/bits.h Drop the macro definition and use GENMASK() instead. Change-Id: I0cc6a58e5aff3f48fa9a79a99bd28124f334c4e2 Signed-off-by: Tomas Vanek <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/9168 Tested-by: jenkins Reviewed-by: Evgeniy Naydanov <[email protected]> Reviewed-by: Antonio Borneo <[email protected]>
1 parent ac6972b commit aa9ff8d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/target/esirisc_trace.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#endif
1111

1212
#include <helper/binarybuffer.h>
13+
#include <helper/bits.h>
1314
#include <helper/command.h>
1415
#include <helper/fileio.h>
1516
#include <helper/log.h>
@@ -18,8 +19,6 @@
1819

1920
#include "esirisc.h"
2021

21-
#define BIT_MASK(x) ((1 << (x)) - 1)
22-
2322
/* Control Fields */
2423
#define CONTROL_ST (1<<0) /* Start */
2524
#define CONTROL_SP (1<<1) /* Stop */
@@ -483,7 +482,7 @@ static int esirisc_trace_analyze_simple(struct command_invocation *cmd, uint8_t
483482
struct target *target = get_current_target(cmd->ctx);
484483
struct esirisc_common *esirisc = target_to_esirisc(target);
485484
struct esirisc_trace *trace_info = &esirisc->trace_info;
486-
const uint32_t end_of_trace = BIT_MASK(trace_info->pc_bits) << 1;
485+
const uint32_t end_of_trace = GENMASK(trace_info->pc_bits, 1);
487486
const uint32_t num_bits = size * 8;
488487
int retval;
489488

0 commit comments

Comments
 (0)