1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-06-10 01:58:48 +00:00

fix style

This commit is contained in:
Gabriele Gristina 2022-02-16 05:40:34 +01:00
parent 7eb66e9936
commit fb12de4be6
2 changed files with 18 additions and 15 deletions

View File

@ -6745,12 +6745,9 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
{
#if defined (__APPLE__)
if (device_param->opencl_platform_vendor_id == VENDOR_ID_APPLE)
{
if (device_param->skipped == false)
{
need_iokit = true;
}
}
#endif
#if defined (__linux__)
@ -6778,16 +6775,15 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
#endif
}
#if defined (__APPLE__)
if (strncmp (device_param->device_name, "Apple M", 7) == 0)
{
if (device_param->opencl_platform_vendor_id == VENDOR_ID_APPLE)
{
if (device_param->skipped == false)
{
need_iokit = true;
}
}
}
#endif
}
if (device_param->opencl_device_type & CL_DEVICE_TYPE_CPU)

View File

@ -249,17 +249,22 @@ int hm_IOKIT_get_utilization_current (void *hashcat_ctx, int *utilization)
{
// Service dictionary creation failed.
IOObjectRelease (regEntry);
continue;
}
CFMutableDictionaryRef perf_properties = (CFMutableDictionaryRef) CFDictionaryGetValue (serviceDictionary, CFSTR ("PerformanceStatistics"));
if (perf_properties)
{
static ssize_t gpuCoreUtil = 0;
const void *gpuCoreUtilization = CFDictionaryGetValue (perf_properties, CFSTR ("Device Utilization %"));
if (gpuCoreUtilization)
if (gpuCoreUtilization != NULL)
{
CFNumberGetValue (gpuCoreUtilization, kCFNumberSInt64Type, &gpuCoreUtil);
*utilization = gpuCoreUtil;
rc = true;
@ -267,12 +272,14 @@ int hm_IOKIT_get_utilization_current (void *hashcat_ctx, int *utilization)
}
CFRelease (serviceDictionary);
IOObjectRelease (regEntry);
IOObjectRelease(iterator);
if (rc == true) break;
}
IOObjectRelease (iterator);
return rc;
}