Skip to content

Commit 9c35303

Browse files
committed
[InstrProf][NFC] Fix warning by removing typecast
This fixes a warning about comparing mismatched types. Since `mmap()` already returns a `void *` use that as the pointer type for comparison. Reviewed By: kyulee, zequanwu Differential Revision: https://reviews.llvm.org/D120945
1 parent a5ee818 commit 9c35303

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler-rt/lib/profile/InstrProfilingFile.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ static int mmapForContinuousMode(uint64_t CurrentFileOffset, FILE *File) {
141141
uint64_t FileOffsetToCounters = CurrentFileOffset +
142142
sizeof(__llvm_profile_header) + DataSize +
143143
PaddingBytesBeforeCounters;
144-
uint64_t *CounterMmap = (uint64_t *)mmap(
145-
(void *)CountersBegin, PageAlignedCountersLength, PROT_READ | PROT_WRITE,
146-
MAP_FIXED | MAP_SHARED, Fileno, FileOffsetToCounters);
144+
void *CounterMmap = mmap((void *)CountersBegin, PageAlignedCountersLength,
145+
PROT_READ | PROT_WRITE, MAP_FIXED | MAP_SHARED,
146+
Fileno, FileOffsetToCounters);
147147
if (CounterMmap != CountersBegin) {
148148
PROF_ERR(
149149
"Continuous counter sync mode is enabled, but mmap() failed (%s).\n"

0 commit comments

Comments
 (0)