From f5fc3ff45046cf165b33880961718c047d83f4db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Mal=C3=BD?= Date: Wed, 6 Aug 2025 22:32:17 +0200 Subject: [PATCH] Do not introduce a new field in i2c_smbus class --- .../SapphireGPUController/SapphireGPUControllerDetect.cpp | 5 ++++- i2c_smbus/Linux/i2c_smbus_linux.cpp | 3 +-- i2c_smbus/Windows/i2c_smbus_amdadl.cpp | 1 - i2c_smbus/i2c_smbus.h | 1 - 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Controllers/SapphireGPUController/SapphireGPUControllerDetect.cpp b/Controllers/SapphireGPUController/SapphireGPUControllerDetect.cpp index c5fe0e6e8..a3f738e1f 100644 --- a/Controllers/SapphireGPUController/SapphireGPUControllerDetect.cpp +++ b/Controllers/SapphireGPUController/SapphireGPUControllerDetect.cpp @@ -47,7 +47,10 @@ bool IsRecognizedI2CBus(i2c_smbus_interface* bus) const char *name; while((name = RECOGNIZED_I2C_BUS_NAMES[idx++]) != nullptr) { - if (std::strcmp(name, bus->bus_name) == 0) return true; + if(std::strcmp(name, bus->device_name) == 0) + { + return true; + } } return false; diff --git a/i2c_smbus/Linux/i2c_smbus_linux.cpp b/i2c_smbus/Linux/i2c_smbus_linux.cpp index 2bf4086d7..d93be68e5 100644 --- a/i2c_smbus/Linux/i2c_smbus_linux.cpp +++ b/i2c_smbus/Linux/i2c_smbus_linux.cpp @@ -232,8 +232,7 @@ bool i2c_smbus_linux_detect() } bus = new i2c_smbus_linux(); - strcpy(bus->device_name, device_path); - strcpy(bus->bus_name, device_string); + strcpy(bus->device_name, device_string); bus->handle = test_fd; bus->pci_device = pci_device; bus->pci_vendor = pci_vendor; diff --git a/i2c_smbus/Windows/i2c_smbus_amdadl.cpp b/i2c_smbus/Windows/i2c_smbus_amdadl.cpp index a298bb6f0..e35c373c1 100644 --- a/i2c_smbus/Windows/i2c_smbus_amdadl.cpp +++ b/i2c_smbus/Windows/i2c_smbus_amdadl.cpp @@ -130,7 +130,6 @@ i2c_smbus_amdadl::i2c_smbus_amdadl(ADL_CONTEXT_HANDLE context, int adapter_index this->pci_subsystem_device = sbd_id; this->port_id = 1; strcpy(this->device_name, "AMD ADL"); - strcpy(this->bus_name, "AMD ADL"); } } } diff --git a/i2c_smbus/i2c_smbus.h b/i2c_smbus/i2c_smbus.h index 0a5e82441..82d5f4a9f 100644 --- a/i2c_smbus/i2c_smbus.h +++ b/i2c_smbus/i2c_smbus.h @@ -77,7 +77,6 @@ class i2c_smbus_interface { public: char device_name[512]; - char bus_name[512]; int port_id; int pci_device;