Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 22
Introduce clang-tidy#920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Introduce clang-tidy #920
Changes from all commits
5135288c422b4c61832ccf53bc124eba32ce7812ed2bdd6e0e20190a33c1a13a03a7eb7cee0f311e4f118d0780cfa748f6a90acbf968474e33be3360e7575f86aadc3ba182001d786d9bcd629ab267998d3b2ec24a32887c788b73File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # SPDX-FileCopyrightText: 2025 Institute for Automation of Complex Power Systems, RWTH Aachen University | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| Checks: > | ||
| -*, | ||
| modernize-use-override, | ||
| WarningsAsErrors: '*' | ||
| HeaderFilterRegex: villas/.* | ||
| FormatStyle: file |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -55,7 +55,7 @@ static const char *vfio_pci_irq_names[] = { | ||
| Device::Device(const std::string &name, int groupFileDescriptor, | ||
| const kernel::devices::PciDevice *pci_device) | ||
| : name(name), fd(-1), attachedToGroup(false), groupFd(groupFileDescriptor), | ||
| info(), info_irq_vectors(), regions(), mappings(), pci_device(pci_device), | ||
| info(), info_irq_vectors(), regions(), mappings(), | ||
| log(Log::get("kernel:vfio:device")) { | ||
| if (groupFileDescriptor < 0) | ||
| throw RuntimeError("Invalid group file descriptor"); | ||
| @@ -254,7 +254,7 @@ bool Device::pciEnable() { | ||
| std::vector<Device::IrqVectorInfo> Device::initEventFds() { | ||
| std::vector<Device::IrqVectorInfo> vectors; | ||
| for (auto info_irq_vector : info_irq_vectors) { | ||
| Device::IrqVectorInfo irq = {0}; | ||
| Device::IrqVectorInfo irq = {.eventFds = {0}}; | ||
| const size_t irqCount = info_irq_vector.count; | ||
| const size_t irqSetSize = | ||
| sizeof(struct vfio_irq_set) + sizeof(int) * irqCount; | ||
| @@ -296,7 +296,7 @@ std::vector<Device::IrqVectorInfo> Device::initEventFds() { | ||
| return vectors; | ||
| } | ||
| int Device::pciMsiInit(int efds[]) { | ||
| int Device::pciMsiInit(int efds[32]) { | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not correct. The function does not work with a fixed length array. ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But that is what the declaration of the function in the header says. The mismatch in declaration and definition signature breaks the clang build. Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok sorry, didn't realize that. In the function itself, we don't do proper bounds checking. ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As far as I can tell, this is the only one of your concerns that remains in the stripped-down version of this MR and wasn't addressed yet. I want to touch as little logic as possible here and therefore I'll do one of 2 things:
Please tell me which one you'd prefer and file an issue if you think that there's a bug here. | ||
| // Check if this is really a vfio-pci device | ||
| if (not isVfioPciDevice()) | ||
| return -1; | ||
| @@ -341,7 +341,7 @@ int Device::pciMsiInit(int efds[]) { | ||
| return irqCount; | ||
| } | ||
| int Device::pciMsiDeinit(int efds[]) { | ||
| int Device::pciMsiDeinit(int efds[32]) { | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is also not correct. See above. | ||
| Log::get("Device")->debug("Deinitializing MSI interrupts for device {}", | ||
| name); | ||
| // Check if this is really a vfio-pci device | ||
| @@ -381,7 +381,7 @@ int Device::pciMsiDeinit(int efds[]) { | ||
| return irqCount; | ||
| } | ||
| bool Device::pciMsiFind(int nos[]) { | ||
| bool Device::pciMsiFind(int nos[32]) { | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also incorrect to specify the length here. | ||
| int ret, idx, irq; | ||
| char *end, *col, *last, line[1024], name[13]; | ||
| FILE *f; | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.