Skip to content

Commit 14c8f1f

Browse files
refactor: remove not used function
Signed-off-by: Mateusz Jablonski <[email protected]>
1 parent 65519b7 commit 14c8f1f

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

shared/source/helpers/l3_range.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2021-2022 Intel Corporation
2+
* Copyright (C) 2021-2024 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -63,10 +63,6 @@ struct L3Range {
6363
return static_cast<uint32_t>(ret);
6464
}
6565

66-
uint64_t getSizeInBytes() const {
67-
return (1ULL << (minAlignmentBitOffset + getMask())); // NOLINT(clang-analyzer-core.UndefinedBinaryOperatorResult)
68-
}
69-
7066
uint64_t getMaskedAddress() const {
7167
return getAddress() & (~maxNBitValue(minAlignmentBitOffset + getMask()));
7268
}

shared/test/unit_test/helpers/l3_range_tests.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2021 Intel Corporation
2+
* Copyright (C) 2021-2024 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -49,17 +49,17 @@ TEST(L3Range, whenTooBigSizeThenMaskCalculationIsAborted) {
4949
EXPECT_THROW(L3Range::getMaskFromSize(l3RangeMax * 2), std::exception);
5050
}
5151

52-
TEST(L3Range, WhenGettingMaskFromSizeThenCorrectSizeIsReturned) {
52+
TEST(L3Range, WhenGettingMaskFromSizeThenCorrectMaskIsSet) {
5353
L3Range range;
5454

5555
range.setMask(L3Range::getMaskFromSize(l3RangeMinimumAlignment));
56-
EXPECT_EQ(l3RangeMinimumAlignment, range.getSizeInBytes());
56+
EXPECT_EQ(0u, range.getMask());
5757

5858
range.setMask(L3Range::getMaskFromSize(l3RangeMinimumAlignment * 4));
59-
EXPECT_EQ(l3RangeMinimumAlignment * 4, range.getSizeInBytes());
59+
EXPECT_EQ(2u, range.getMask());
6060

6161
range.setMask(L3Range::getMaskFromSize(l3RangeMax));
62-
EXPECT_EQ(l3RangeMax, range.getSizeInBytes());
62+
EXPECT_EQ(32u - L3Range::minAlignmentBitOffset, range.getMask());
6363
}
6464

6565
TEST(L3Range, whenMaskGetsChangedThenReturnsProperlyMaskedAddress) {
@@ -154,7 +154,7 @@ TEST(CoverRange, whenNonAlignedThenAbort) {
154154

155155
L3Range fromAdjacentRange(const L3Range &lhs, uint64_t size) {
156156
L3Range ret;
157-
ret.setAddress(lhs.getMaskedAddress() + lhs.getSizeInBytes());
157+
ret.setAddress(lhs.getMaskedAddress() + maxNBitValue(L3Range::minAlignmentBitOffset + lhs.getMask()) + 1);
158158
ret.setMask(L3Range::getMaskFromSize(size));
159159
return ret;
160160
}

0 commit comments

Comments
 (0)