1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-06-06 16:18: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

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

View File

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