Skip to content

Commit

Permalink
fix: Fix getCardCount return type and use it in getCard
Browse files Browse the repository at this point in the history
  • Loading branch information
VisualEhrmanntraut committed Nov 4, 2024
1 parent 2c6ebac commit 8104c8c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions SMCRadeonSensors/SMCRadeonSensors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,10 @@ void PRODUCT_NAME::free() {
IOService::free();
}

UInt32 PRODUCT_NAME::getCardCount() { return this->cards ? this->cards->getCount() : 0; }

SMCRSCard *PRODUCT_NAME::getCard(UInt32 index) {
if (this->cards == nullptr || index >= this->cards->getCount()) { return nullptr; }
if (index >= this->getCardCount()) { return nullptr; }
return OSDynamicCast(SMCRSCard, this->cards->getObject(index));
}

Expand All @@ -140,8 +142,6 @@ UInt16 PRODUCT_NAME::getTemperature(UInt32 index) {
return temp;
}

UInt16 PRODUCT_NAME::getCardCount() { return this->cards ? this->cards->getCount() : 0; }

EXPORT extern "C" kern_return_t ADDPR(kern_start)(kmod_info_t *, void *) {
lilu_get_boot_args("liludelay", &ADDPR(debugPrintDelay), sizeof(ADDPR(debugPrintDelay)));
ADDPR(debugEnabled) = checkKernelArgument("-RSDebug") || checkKernelArgument("-liludbgall");
Expand Down
2 changes: 1 addition & 1 deletion SMCRadeonSensors/SMCRadeonSensors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ class EXPORT PRODUCT_NAME : public IOService {
void free() APPLE_KEXT_OVERRIDE;
void stop(IOService *provider) APPLE_KEXT_OVERRIDE;

virtual UInt32 getCardCount();
virtual SMCRSCard *getCard(UInt32 index);
virtual UInt16 getTemperature(UInt32 index);
virtual UInt16 getCardCount();

static bool vsmcNotificationHandler(void *target, void *refCon, IOService *newService, IONotifier *notifier);
};

0 comments on commit 8104c8c

Please sign in to comment.