Skip to content

Commit e9be9b6

Browse files
clang-tidy configuration cleanup
Define single .clang-tidy configuration with all used checks and use NOLINT to selectively silence tool. That way cleanup should be easier. third_part/ has its own configuration that disables clang-tidy for this folder. Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
1 parent 910871a commit e9be9b6

File tree

235 files changed

+920
-1169
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

235 files changed

+920
-1169
lines changed

.clang-tidy

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
Checks: 'clang-diagnostic-*,clang-analyzer-*,google-default-arguments,readability-identifier-naming,modernize-use-override,modernize-use-default-member-init,-clang-analyzer-alpha*'
3-
# WarningsAsErrors: '.*'
4-
HeaderFilterRegex: '^((?!^third_party\/).+)\.(h|hpp|inl)$'
3+
WarningsAsErrors: '.*'
4+
HeaderFilterRegex: '(shared|opencl|level_zero).+\.(h|hpp|inl)$'
55
AnalyzeTemporaryDtors: false
66
CheckOptions:
77
- key: google-readability-braces-around-statements.ShortStatementLines
@@ -16,8 +16,6 @@ CheckOptions:
1616
value: camelBack
1717
- key: readability-identifier-naming.ParameterCase
1818
value: camelBack
19-
- key: readability-identifier-naming.StructMemberCase
20-
value: camelBack
2119
- key: readability-identifier-naming.ClassMemberCase
2220
value: camelBack
2321
- key: readability-identifier-naming.ClassMethodCase

level_zero/core/source/context/context.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct Context : _ze_context_handle_t {
3535
return ZE_MEMORY_TYPE_UNKNOWN;
3636
}
3737

38-
virtual ~Context() = default;
38+
~Context() override = default;
3939
virtual ze_result_t destroy() = 0;
4040
virtual ze_result_t getStatus() = 0;
4141
virtual DriverHandle *getDriverHandle() = 0;

level_zero/core/source/device/device_imp.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -414,10 +414,10 @@ ze_result_t DeviceImp::getPciProperties(ze_pci_ext_properties_t *pPciProperties)
414414
}
415415
auto pciBusInfo = driverInfo->getPciBusInfo();
416416
auto isPciValid = [&](auto pci) -> bool {
417-
return (pci.pciDomain != NEO::PhysicalDevicePciBusInfo::InvalidValue &&
418-
pci.pciBus != NEO::PhysicalDevicePciBusInfo::InvalidValue &&
419-
pci.pciDevice != NEO::PhysicalDevicePciBusInfo::InvalidValue &&
420-
pci.pciFunction != NEO::PhysicalDevicePciBusInfo::InvalidValue);
417+
return (pci.pciDomain != NEO::PhysicalDevicePciBusInfo::invalidValue &&
418+
pci.pciBus != NEO::PhysicalDevicePciBusInfo::invalidValue &&
419+
pci.pciDevice != NEO::PhysicalDevicePciBusInfo::invalidValue &&
420+
pci.pciFunction != NEO::PhysicalDevicePciBusInfo::invalidValue);
421421
};
422422
if (!isPciValid(pciBusInfo)) {
423423
return ZE_RESULT_ERROR_UNINITIALIZED;

level_zero/core/source/driver/driver_handle_imp.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ struct DriverHandleImp : public DriverHandle {
5757
ze_result_t releaseImportedPointer(void *ptr) override;
5858
ze_result_t getHostPointerBaseAddress(void *ptr, void **baseAddress) override;
5959

60-
virtual NEO::GraphicsAllocation *findHostPointerAllocation(void *ptr, size_t size, uint32_t rootDeviceIndex) override;
61-
virtual NEO::GraphicsAllocation *getDriverSystemMemoryAllocation(void *ptr,
62-
size_t size,
63-
uint32_t rootDeviceIndex,
64-
uintptr_t *gpuAddress) override;
60+
NEO::GraphicsAllocation *findHostPointerAllocation(void *ptr, size_t size, uint32_t rootDeviceIndex) override;
61+
NEO::GraphicsAllocation *getDriverSystemMemoryAllocation(void *ptr,
62+
size_t size,
63+
uint32_t rootDeviceIndex,
64+
uintptr_t *gpuAddress) override;
6565
NEO::GraphicsAllocation *getPeerAllocation(Device *device,
6666
NEO::SvmAllocationData *allocData,
6767
void *basePtr,

level_zero/core/source/event/event.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ struct EventPoolImp : public EventPool {
248248

249249
ze_result_t initialize(DriverHandle *driver, Context *context, uint32_t numDevices, ze_device_handle_t *phDevices);
250250

251-
~EventPoolImp();
251+
~EventPoolImp() override;
252252

253253
ze_result_t destroy() override;
254254

level_zero/core/test/.clang-tidy

Lines changed: 0 additions & 34 deletions
This file was deleted.

level_zero/core/test/aub_tests/fixtures/aub_fixture.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ class AUBFixtureL0 {
4141
public:
4242
AUBFixtureL0();
4343
virtual ~AUBFixtureL0();
44-
void SetUp();
45-
void SetUp(const NEO::HardwareInfo *hardwareInfo, bool debuggingEnabled);
46-
void TearDown();
44+
void SetUp(); // NOLINT(readability-identifier-naming)
45+
void SetUp(const NEO::HardwareInfo *hardwareInfo, bool debuggingEnabled); // NOLINT(readability-identifier-naming)
46+
void TearDown(); // NOLINT(readability-identifier-naming)
4747
static void prepareCopyEngines(NEO::MockDevice &device, const std::string &filename);
4848

4949
template <typename FamilyType>
@@ -110,4 +110,4 @@ class AUBFixtureL0 {
110110
NEO::CommandStreamReceiver *csr = nullptr;
111111
};
112112

113-
} // namespace L0
113+
} // namespace L0

level_zero/core/test/black_box_tests/zello_copy_only.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void testCopyBetweenHeapDeviceAndStack(ze_context_handle_t &context, ze_device_h
3030
ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC};
3131
int32_t copyQueueGroup = getCopyOnlyCommandQueueOrdinal(device);
3232
if (copyQueueGroup < 0) {
33-
std::cout << "No Copy queue group found. Skipping test run\n";
33+
std::cout << "No Copy queue group found. Skipping test run\n"; // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks)
3434
validRet = true;
3535
return;
3636
}
@@ -105,7 +105,7 @@ void testCopyBetweenHostMemAndDeviceMem(ze_context_handle_t &context, ze_device_
105105
ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC};
106106
int32_t copyQueueGroup = getCopyOnlyCommandQueueOrdinal(device);
107107
if (copyQueueGroup < 0) {
108-
std::cout << "No Copy queue group found. Skipping test run\n";
108+
std::cout << "No Copy queue group found. Skipping test run\n"; // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks)
109109
validRet = true;
110110
return;
111111
}
@@ -310,7 +310,7 @@ void testSharedMemDataAccessWithoutCopy(ze_context_handle_t &context, ze_device_
310310
ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC};
311311
int32_t copyQueueGroup = getCopyOnlyCommandQueueOrdinal(device);
312312
if (copyQueueGroup < 0) {
313-
std::cout << "No Copy queue group found. Skipping test run\n";
313+
std::cout << "No Copy queue group found. Skipping test run\n"; // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks)
314314
validRet = true;
315315
return;
316316
}

level_zero/core/test/black_box_tests/zello_ipc_copy_dma_buf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static int recvmsgForIpcHandle(int socket, char *payload) {
6464
return -1;
6565
}
6666
struct cmsghdr *controlHeader = CMSG_FIRSTHDR(&msgHeader);
67-
memmove(&fd, CMSG_DATA(controlHeader), sizeof(int));
67+
memmove(&fd, CMSG_DATA(controlHeader), sizeof(int)); // NOLINT(clang-analyzer-core.NonNullParamChecker)
6868
memmove(payload, recvBuf, sizeof(recvBuf));
6969
return fd;
7070
}

level_zero/core/test/unit_tests/fixtures/aub_csr_fixture.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2021 Intel Corporation
2+
* Copyright (C) 2021-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -20,14 +20,14 @@ namespace L0 {
2020
namespace ult {
2121
struct AubCsrFixture : public ContextFixture {
2222
template <typename T>
23-
void SetUpT() {
23+
void setUpT() {
2424
auto csrCreateFcn = &commandStreamReceiverFactory[IGFX_MAX_CORE + NEO::defaultHwInfo->platform.eRenderCoreFamily];
2525
variableBackup = std::make_unique<VariableBackup<CommandStreamReceiverCreateFunc>>(csrCreateFcn);
2626
*csrCreateFcn = UltAubCommandStreamReceiver<T>::create;
2727
ContextFixture::SetUp();
2828
}
2929
template <typename T>
30-
void TearDownT() {
30+
void tearDownT() {
3131
ContextFixture::TearDown();
3232
}
3333

0 commit comments

Comments
 (0)