Skip to content

Commit 060fa37

Browse files
committed
fixup
1 parent d577667 commit 060fa37

File tree

17 files changed

+33
-6125
lines changed

17 files changed

+33
-6125
lines changed

cmake/FindFileSystem.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ cmake_push_check_state(RESET)
1818
check_cxx_source_compiles("${FILESYSTEM_TEST_CODE}" CXX17_FILESYSTEM)
1919
cmake_pop_check_state()
2020

21-
unset(FILESYSTEM_TEST_CODE)
21+
unset(FILESYSTEM_TEST_CODE)

common/include/villas/fs.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
#include <villas/config.hpp>
88

99
#ifdef WITH_GHC_FS
10-
#include <ghc/filesystem.hpp>
11-
namespace fs = ghc::filesystem;
10+
#include <ghc/filesystem.hpp>
11+
namespace fs = ghc::filesystem;
1212
#else
13-
#include <filesystem>
14-
namespace fs = std::filesystem;
15-
#endif
13+
#include <filesystem>
14+
namespace fs = std::filesystem;
15+
#endif

common/include/villas/kernel/devices/ip_device.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ class IpDevice : public PlatformDevice {
2424

2525
private:
2626
IpDevice() = delete;
27-
IpDevice(
28-
const fs::path valid_path) //! Dont allow unvalidated paths
29-
: PlatformDevice(valid_path){};
27+
IpDevice(const fs::path valid_path) //! Dont allow unvalidated paths
28+
: PlatformDevice(valid_path) {};
3029

3130
public:
3231
size_t addr() const;

common/include/villas/kernel/devices/linux_driver.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,11 @@ class LinuxDriver : public Driver {
3333
public:
3434
LinuxDriver(const fs::path path)
3535
: LinuxDriver(path, path / fs::path(BIND_DEFAULT),
36-
path / fs::path(UNBIND_DEFAULT)){};
36+
path / fs::path(UNBIND_DEFAULT)) {};
3737

38-
LinuxDriver(const fs::path path,
39-
const fs::path bind_path,
38+
LinuxDriver(const fs::path path, const fs::path bind_path,
4039
const fs::path unbind_path)
41-
: path(path), bind_path(bind_path), unbind_path(unbind_path){};
40+
: path(path), bind_path(bind_path), unbind_path(unbind_path) {};
4241

4342
public:
4443
void attach(const Device &device) const override;

common/include/villas/kernel/devices/platform_device.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ class PlatformDevice : public Device {
2929
public:
3030
PlatformDevice(const fs::path path)
3131
: PlatformDevice(path, fs::path(PROBE_DEFAULT),
32-
path / fs::path(OVERRIDE_DEFAULT)){};
32+
path / fs::path(OVERRIDE_DEFAULT)) {};
3333

34-
PlatformDevice(const fs::path path,
35-
const fs::path probe_path,
34+
PlatformDevice(const fs::path path, const fs::path probe_path,
3635
const fs::path override_path)
3736
: m_path(path), m_probe_path(probe_path),
3837
m_override_path(override_path){};

common/include/villas/utils.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
#include <signal.h>
2121
#include <sys/types.h>
2222

23-
#include <villas/fs.hpp>
2423
#include <villas/config.hpp>
24+
#include <villas/fs.hpp>
2525

2626
#ifdef __GNUC__
2727
#define LIKELY(x) __builtin_expect((x), 1)
@@ -213,8 +213,7 @@ template <class... Ts> struct overloaded : Ts... {
213213
template <class... Ts> overloaded(Ts...) -> overloaded<Ts...>;
214214

215215
void write_to_file(std::string data, const fs::path file);
216-
std::vector<std::string>
217-
read_names_in_directory(const fs::path &directory);
216+
std::vector<std::string> read_names_in_directory(const fs::path &directory);
218217

219218
namespace base64 {
220219

common/lib/kernel/devices/device_connection.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ DeviceConnection DeviceConnection::from(
2626
auto logger = villas::Log::get("Builder: DeviceConnection");
2727

2828
// Bind the devicetree device to vfio driver
29-
LinuxDriver driver(
30-
fs::path("/sys/bus/platform/drivers/vfio-platform"));
29+
LinuxDriver driver(fs::path("/sys/bus/platform/drivers/vfio-platform"));
3130
driver.attach(device);
3231

3332
// Attach vfio container to the iommu group

common/lib/kernel/devices/ip_device.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#include <regex>
1010
#include <stdexcept>
1111

12-
#include <villas/fs.hpp>
1312
#include <villas/exceptions.hpp>
13+
#include <villas/fs.hpp>
1414
#include <villas/kernel/devices/ip_device.hpp>
1515
#include <villas/utils.hpp>
1616

@@ -62,8 +62,7 @@ IpDevice::from_directory(fs::path devices_directory) {
6262
villas::utils::read_names_in_directory(devices_directory);
6363

6464
for (auto devicetree_name : devicetree_names) {
65-
auto path_to_device =
66-
devices_directory / fs::path(devicetree_name);
65+
auto path_to_device = devices_directory / fs::path(devicetree_name);
6766
try {
6867
auto device = villas::kernel::devices::IpDevice::from(path_to_device);
6968
devices.push_back(device);

common/lib/kernel/devices/platform_device.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,17 @@ using villas::kernel::devices::PlatformDevice;
1515
using villas::utils::write_to_file;
1616

1717
std::optional<std::unique_ptr<Driver>> PlatformDevice::driver() const {
18-
fs::path driver_symlink =
19-
this->m_path / fs::path("driver");
18+
fs::path driver_symlink = this->m_path / fs::path("driver");
2019

2120
if (!fs::is_symlink(driver_symlink))
2221
return std::nullopt;
2322

24-
fs::path driver_path =
25-
fs::canonical(driver_symlink);
23+
fs::path driver_path = fs::canonical(driver_symlink);
2624
return std::make_optional(std::make_unique<LinuxDriver>(driver_path));
2725
}
2826

2927
std::optional<int> PlatformDevice::iommu_group() const {
30-
fs::path symlink =
31-
fs::path(this->m_path.u8string() + "/iommu_group");
28+
fs::path symlink = fs::path(this->m_path.u8string() + "/iommu_group");
3229

3330
fs::path link = fs::read_symlink(symlink);
3431
std::string delimiter = "iommu_groups/";
@@ -43,8 +40,6 @@ void PlatformDevice::probe() const {
4340
write_to_file(this->name(), this->m_probe_path);
4441
}
4542

46-
fs::path PlatformDevice::override_path() const {
47-
return this->m_override_path;
48-
}
43+
fs::path PlatformDevice::override_path() const { return this->m_override_path; }
4944

5045
std::string PlatformDevice::name() const { return this->m_path.filename(); }

common/lib/utils.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
#include <pthread.h>
2828
#include <unistd.h>
2929

30-
#include <villas/fs.hpp>
3130
#include <villas/colors.hpp>
3231
#include <villas/config.hpp>
3332
#include <villas/exceptions.hpp>
33+
#include <villas/fs.hpp>
3434
#include <villas/log.hpp>
3535
#include <villas/utils.hpp>
3636

@@ -362,13 +362,11 @@ void write_to_file(std::string data, const fs::path file) {
362362
outputFile << data;
363363
outputFile.close();
364364
} else {
365-
throw fs::filesystem_error("Cannot open outputfile",
366-
std::error_code());
365+
throw fs::filesystem_error("Cannot open outputfile", std::error_code());
367366
}
368367
}
369368

370-
std::vector<std::string>
371-
read_names_in_directory(const fs::path &directory) {
369+
std::vector<std::string> read_names_in_directory(const fs::path &directory) {
372370
std::vector<std::string> names;
373371
for (auto const &dir_entry : fs::directory_iterator{directory}) {
374372
names.push_back(dir_entry.path().filename());

0 commit comments

Comments
 (0)